Hi all,

from some time i was dreaming to do a little game compatible for w95/98 with no directX. Just a little and easy game to demonsrtrate asm power.

This is the first step: two stars backgronds scrolling (one fast and the other slower) and a starship (fire with space bar).

Now i like it very much but it's too much slow.

If someone have some minutes to spend, I would appreciate any suggestion for speed up these easy scrolling.

If some help, thanks A
Posted on 2001-09-26 14:12:00 by Bit7
oops, forget the .exe
Posted on 2001-09-26 14:16:41 by Bit7
Hi angelo, should this not have been in the game programming section? Anyway...

A) I can't run it under win2k. My best guess is that this has to with the fact that edi isn't preserved.

B) I couldn't test this theory as you forgot to include spacet.inc.

Otherwise it looked promising.
Posted on 2001-09-26 16:38:58 by Eóin
i have moved it to the Game section where it belongs,

besides i will check your code and advice about where to improve it, GDI was not that slow when we used it in HE...
Posted on 2001-09-26 17:02:34 by BogdanOntanu
Eoin, Bogdan,

thanks you all for the interest !

Sorry to forget the include and rc ... attached is the entire project..

Bye
Posted on 2001-09-28 16:02:23 by Bit7
Angelo, unfortunatly its written in Tasm so I can't compile it. I suggest you try and preserve edi, esi and ebx through out the WinProc (Looking at the code I think only edi needs preserveing) And post that exe here.

Hopefully that will solve the Win2k problems.
Posted on 2001-09-28 17:39:36 by Eóin
Angelo i like the fact thet you use two bitmaps..thats neat

However i think scrolling bitmaps is a very heavy load on the processor...especially of that size.

What you should do is create a black background and set pixels on and off for your stars

All your star data can be put in an array including color ,x position ,y position and even star size

you can change the data in your array while at the same time reading it

Just make your code able to read your array the way you want

And sure it will take a little work but it will take a hell of a load off the processor and speed thing ups dramatcally...like about a thousand times. This is because every pixel in your bitmap has to be processed whereas if you have a black bacground only the pixel representing the stars have to be turned on, turned off and then the position for them updated in your array.

Put it in a thread so you dont lose mouse control.


Oh yes ..you can also generate random values as you go so your star feild will never repeat itself exacty.

NaN has a great random number generator i started using in my prog.

I still have it but i am too lazey to look right now. If your interested in just replie and i'll post it in this thread.

Maybe you already downloaded it.
:alright:
Posted on 2001-09-28 20:00:57 by titan
Hi all !
Eoin,
i've re-compiled, now only edi is preserved. All work fine.
attached the game complete with new exe. Hope now it run in 2K.

Hei titan,
your is a great idea !
I just need to learn correct syntax and data definition for arrays, i've never used them till now. Just a little time to learn and then i will try with SetPixel !
I have already have a random generator, is the one you see in the code of the game. Could it work fine ?

Thanks all,

Bye
Posted on 2001-09-29 08:07:00 by Bit7
angelo,

your game doesn't run on WinNT 4.0 (GPF when I press a key). I dont have TASM so I cant compile it. Would you please be so kind and make another copy and save esi,edi and ebx registers in functions WinProc and GameLoop?

japheth
Posted on 2001-10-01 07:15:07 by japheth
hi all,

with your help and suggestions a step forward has been done, i think.

Japheth,
i've preserved esi, edi and ebx on both routines you mentioned.
Hope it now can run in 2K. Let me know if it is, i'm interested also in compatibility.

Titan,
look at the new much more fast scrolling done with an array of pixels ! It seem wonderful !

Thanks all ! Next step will be a second slower stars background, to give a tridimensional effect.

Bye
Posted on 2001-10-02 16:35:50 by Bit7
angelo if you were pleased with using an array to speed up the scrolling background thats great.
To get your tridimensional effect you don't have to use a different array.

Just make some element in the array scroll at different speeds....like every second one.

Heck...maybe you go further and make every element based on division by 2,3, 4 scroll at different speeds.

just a thought.
:alright:
Posted on 2001-10-02 22:20:46 by titan
thanks titan !

if you don't told me this, i sure had create a second array :(


thanks again :alright: :alright:

@ next step

bye
Posted on 2001-10-03 00:59:53 by Bit7
angelo,

IN/OUT isnt allowed in WinNT/2k. This will not work:



; starship position
Starship: in ax,60h

cmp al,4bh
je MoveLeft
cmp al,4dh


japheth
Posted on 2001-10-04 04:44:07 by japheth