Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - rain_storm

Pages: 1 [2] 3 4 5 6 7 8 9 ... 69
General chat / Re: Smooth interpolation...
« on: November 17, 2012 »
Very nice resource.

Projects / Re: A game project I'm working on
« on: November 14, 2012 »
really nice visuals, I've always wanted to work on something like this, myself.

I found a good tutorial by HugoElias. The cool map alone wasn't enough to make it look good though. I had to play around with the pallet. This pallet worked best

Code: [Select]
for (int colour = 0; colour < 256; colour++) {
    Blue  = 0
    Green = min(2*colour, 255)
    Red   = min(4*colour, 255)

Here is the final release

Basic fire effect as seen at Lodes Site
Produces effects such as the attached exe.

Now I have 64 bytes spare after this basic effect is in place and would like to make use of those bytes by improving the visuals. What options are available, How would I go about adding a coolmap for example?

Yabasic / Re: YA-GOLF MINI Super challengue
« on: September 15, 2012 »
Amazing work, I'm surprised that you managed to fit so many images into the source code when it's less than 600 KB. That alone is impressive. The overall design is worthy of praise. Much as I love yabasic, your skills are wasted on such a restrictive platform.

C / C++ /C# / Re: Visual c++ code optimization.
« on: May 07, 2012 »
Read Agner Fog's Optimization Manuals they are the de facto resource on the matter.

C / C++ /C# / Re: Visual c++ code optimization.
« on: May 05, 2012 »
Now take a look at this thread.

General coding questions / Re: Convert RPM
« on: May 05, 2012 »
Revolutions Per Minute

One Revolution as an angle is 2.0*pi radians. That's the easy part. The hard part is determining exactly how long a minute is in ticks. If you know that your game renders at 30 frames per second you can take that as a rough estimate of the speed.
Minute = 60*Second/30 (frames)

So RPM = 2.0*pi / (60*Second/30)

You could get this far more accurate but it's alot of work and this estimate should be good enough for your needs.

Here's my c++ for calculating the same (uses win32)

Code: [Select]
// set up the high resolution timer
if (!QueryPerformanceFrequency((LARGE_INTEGER*)&tick.TicksPerSecond)) {
return Error("MetricStartUp - Failed to obtain the CPU speed!");
if (!QueryPerformanceCounter((LARGE_INTEGER*)&tick.FirstTick)) {
return Error("MetricStartUp - Failed to read the high resolution time stamp counter!");
tick.OldTick  = tick.FirstTick;
tick.CurTick  = tick.FirstTick;
tick.NumTicks = tick.CurTick - tick.FirstTick;
tick.TicksPerSecond = max(tick.TicksPerSecond, 1);

// calculate durations and speeds in clock cycles
metric.second      = (unsigned __int32)(tick.TicksPerSecond&0x00000000FFFFFFFF);
metric.millisecond = metric.second / 1000;
metric.minute      = 60*metric.second;
metric.hour        = 60*metric.minute;
metric.rpm         = 2*Π/metric.minute;  // revolutions per minute
metric.mps         = 1.0f/metric.second; // meters per second

Extra respect for doing this in Flash.

C / C++ /C# / Re: Visual c++ code optimization.
« on: May 02, 2012 »
This is geared towards MSVC 2008 but it should be compatible.

[1] create an empty Win32 Console Application.
[2] Then set the Configuration to "Release"
[3] Now add a new cpp file to the project (Project -> Add New Item) named tiny.cpp
[4] Paste the following into tiny.cpp
Code: [Select]
#include <windows.h>
int main(void)
MessageBoxA(0, "Hello World!", 0, 0);
return 0;
[5] Build the solution (Build -> Build Solution) and you should get a 7KB executable.
[6] Open the Project Settings DialogBox (Project -> Properties) and apply the
following settings:
Code: [Select]
Configuration Properties - General - Character Set - Not Set
Configuration Properties - Manifest Tool - Input and Output - Embed Manifest - No
Configuration Properties - Build Events - Post Build Events - Command Line - cmd /c dir "$(TargetPath)"
Configuration Properties - C/C++ - General - Debug Information Format - Disabled
Configuration Properties - C/C++ - Optimization - Omit Frame Pointers - Yes
Configuration Properties - C/C++ - Optimization - Enable Fibre Safe Optimizations - Yes
Configuration Properties - C/C++ - Code Generation - Enable C++ Exceptions - No
Configuration Properties - C/C++ - Code Generation - Runtime Library - Multi Threaded DLL
Configuration Properties - C/C++ - Code Generation - Buffer Security Check - No
Configuration Properties - Linker - Input - Ignore Default Libraries - Yes
Configuration Properties - Linker - Manifest File - Generate Manifest - No
Configuration Properties - Linker - Debugging - Generate Debug Info - No
Configuration Properties - Linker - Advanced - Randomize Base Address - Default
Configuration Properties - Linker - Advanced - Data Execution Prevention - Default

[7] Replace the contents of tiny.cpp with the following:
Code: [Select]
#include <windows.h>
void mainCRTStartup(void)
MessageBoxA(0, "Hello World!", 0, 0);
[8] Rebuild the solution (Build -> Rebuild Solution) and you should get a 2KB program.
[9] Back in the Project Settings DialogBox (Project -> Properties) add the following
command line arguments to the linker:
Code: [Select]
Configuration Properties - Linker - Command Line - Additional Options -

[10] Rebuild the solution (Build -> Rebuild Solution) and you should get it down to 672 bytes.
[11] Return to the Project Settings (Project -> Properties) replace the previous
Command Line Arguments for the linker with this new and revised version:
Code: [Select]
Configuration Properties - Linker - Command Line - Additional Options -


[12] After rebuilding (Build -> Rebuild Solution) you should be greeted with an executable thats only 608 bytes.

[13] Create a new file called stub.asm and paste the following into it:
Code: [Select]
format binary as 'exe'
 mzhdr:                       ;
    .e_magic    dw "MZ"       ;
    .e_cblp     dw 0x0090     ;
    .e_cp       dw 0x0003     ;
    .e_crlc     dw 0x0000     ;
    .e_cparhdr  dw 0x0004     ;
    .e_minalloc dw 0x0000     ;
    .e_maxalloc dw 0xFFFF     ;
    .e_ss       dw 0x0000     ;
    .e_sp       dw 0x00B8     ;
    .e_csum     dw 0x00C3     ; .entry: ret
    .e_ip       dw 0x0012     ; @.entry
    .e_cs       dw 0x0000     ;
    .e_lsarlc   dw 0x0040     ;
    .e_ovno     dw 0x0000     ;
    .e_res      dw 4 dup ?    ;
    .e_oemid    dw 0x0000     ;
    .e_oeminfo  dw 0x0000     ;
    .e_res2     dw 10 dup ?   ;
    .e_lfanew   dd 0x00000000 ;
[14] Assemble stub.asm using FASM and you should see a file stub.exe thats 64 bytes.
[15] Back in Visual Studio's Project Settings (Project -> Properties) we're going to
over-ride the default stub with our own custom stub. Replace the existing linker
Command Line Arguments with the following:
Code: [Select]
Configuration Properties - Linker - Command Line - Additional Options -



[16] Rebuild the Solution (Build -> Rebuild Solution) and you have 560 bytes.
[17] Then take the patched version of link.exe that I supply here and place it in your project directory and rebuild

480 bytes

any lower than that and you'll have to use an assembler.

But this is a lot of work for little reward. Best to just use a good compressor such as crinkler.

Edit : Va!n here's the same project you posted but got the size down to 944 bytes using the above settings.

Thank God you made a video capture.

ASM / Re: Raymarching in 512 bytes
« on: April 29, 2012 »
Yes please, and thank you very much.

ASM / Re: Raymarching in 512 bytes
« on: April 29, 2012 »
A shame, Here's the original but it has changed quite alot from this to the final production. The colours are all gone and the sinewave no longer oscilates.

ASM / Raymarching in 512 bytes
« on: April 29, 2012 »
Here's a tiny effect coded using my 512b framework. It's slow as hell and ugly as sin but for some weird reason I'm kinda proud of it. I really hope this runs on Vista/Windows 7 as it's only been tested on XP SP3. Full source has been included along with the tool used to obtain the import function hashes. No compression was used during the making of this effect.

Yabasic / Re: Button bash bullets
« on: April 29, 2012 »
You could make a nice retro shoot em up out of this.

ASM / Re: 2560 bytes of FASM
« on: February 24, 2012 »
How many sections does your exe have, and what are they named? You can get the size down by merging all sections into a single ".flat" section.

Projects / Re: Raymarching stuff
« on: December 26, 2011 »
Pretty in pink.

That was amazing. Bravo!

So many effects! nice job on all of them.

I found this tutorial very useful when I was looking into A* a few years back. It would probably be best to get the function working for square cells before scaling it up to hexagons.

I think there should be a return or a break instead of continue in this if statement
Code: [Select]
if (X.position == goalNode.position)

Code: [Select]
while (NumOpenNodes > 0) {
    if (current node is the target node) break;
    find the node with the lowest cost and add it to the closed list
    for (each of its neighbours that is open and walkable) {
        if (NeighbourNode has no parent) {
            make the low cost node the parent of the neighbour node
        } else if (This path is superior to the previous parent path) {
            make the low cost node the parent of the neighbour node

Pages: 1 [2] 3 4 5 6 7 8 9 ... 69