ASMCast

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
Lithium
Posts: 298
Joined: Jun 06, 2005 17:53
Location: Nova Scotia, Canada
Contact:

Post by Lithium »

Allright... I said I wasn't going to optimize anymore without writing new features -- but I couldn't help myself.

Previously, I was calling a function that would clear the backbuffer before rendering the frame -- this was nescessary, when there wasn't floor or ceiling, but isn't anymore... so I disabled it, and to my amazement:

(1ghz 256mb ram):

320x240: 150->170 fps (increase of ~30)
640x480: 50 fps (increase of 10)
1024x768: 20 fps (??)

( http://lithium.zext.net/asmcast_test.zip )

anyway, I'm doing the sprite system now... in contrast to the previous engine, sprites in this one will be added on a per-frame basis.. sounds like a lot of work, but the idea is to mimic the traditional 2d 'PUT' concept, which should be more intuitive to some game programmers (including myself).. this also got me thinking about how the api will work, here's an example in pseudo code:

Code: Select all

set_light ( &H004000, 3.0 ) ' 64 green (0 red, blue), intensity 3.0
set_map ( varptr(mapData), 64, 64 ) ' set map of size 64x64

do

  set_buffer ( varptr(offscreenBuffer), width, height ) ' width and height can change per/frame

  set_position ( player.x, player.y, player.angle, player.z, player.look )

  bb_sprite ( varptr(someMonster), 10, 10, 0 ) ' x, y, z
  bb_sprite ( varptr( .... etc

  render_frame

  put (0, 0), offscreenBuffer, pset

loop until multikey(VK_ESC)
if you notice the width and height are dynamic, which means you could do what wolfenstien 3d does (i.e. +/- changes the screen size)

any thoughts?
KiZ
Posts: 48
Joined: Aug 25, 2005 7:38
Location: UK
Contact:

Post by KiZ »

Very nice. I'm getting 920/250/90 fps respectively.

the 1024x768 slows down considerably close to the walls, all the way down to 20 fps when I am right next to them.

Good work. Will we see a game this time? :p
Lithium
Posts: 298
Joined: Jun 06, 2005 17:53
Location: Nova Scotia, Canada
Contact:

Post by Lithium »

Thanks...

I really have yet to see why it slows down so much in hi-res close too a wall, the inner loop is small, and fast... no muls or divs or anything like that, just one memory read and one memory write, and pointer updating... if it's not something insanley stupid I did, maybe I should look into using SSE.

EDIT:

The possibility for a game by me is there, although it depends on weather or not I can find a reliable artist (which was the downfall of the janitor)... although he said he was interested in working on it again, I don't know if I can trust his motivation.

But aside from that I hope nek will make use of it, he made good use of the last one. Or anyone else who wants to make a 3D(ish) game without a lot of hassle.
Peter
Posts: 66
Joined: May 29, 2006 22:16

Post by Peter »

This looks very interesting. I've never been into coding games, but the combination of graphics, light weight, and (if the pseudo-code is any indication) simple API has got me thinking twice about that.
Looking forward to what's next
Edit (I'm at work right now so I can't run a test but you will defiantly get one once I'm home)
badmrbox
Posts: 664
Joined: Oct 27, 2005 14:40
Location: Sweden
Contact:

Post by badmrbox »

I'm surely going to use this engine as soon as I have finished the game we are making with your old engine :)
Lithium
Posts: 298
Joined: Jun 06, 2005 17:53
Location: Nova Scotia, Canada
Contact:

Post by Lithium »

Allright... I've been away from it for a few weeks, but had some time as it is now my spring break...

http://lithium.zext.net/asmcast.zip
Image

Sprites are done, the features are:

- Sprites of any power of 2 dimensions
- Normal sprite size setting (i.e. a sprite of this size is as tall as a wall, to allow adjustment of detail)
- Z coordinate (Z=0 means, bottom of sprite touches floor, Z=127 means bottom of sprite is on the ceeling)
- Alpha blending (0-15, 15 = full opacity, 0 = fully transparent)

Anyway, the two issues are...
- Sprites taller than walls look a little weird...
I don't think I will try and address this, and don't have any good ideas as to how

- Alpha blending cuts down some colour detail, and there are only 16 levels of alpha
Once this is turned into a lib, if people need more detail, I can adjust at the cost of size

Ok, so on the todo list now;

- Dynamic tiles (for doors, secrets, etc..)
- Crouch/Jump/Look
- Create FB Lib
- Build wrapper functions and game helper functions
mov eax, SUCCESS
ret.

sound good? :)

P.S. the monster sprite is from a free sprite page, my appologies to the author I forgot the url... and the a dog is from earthbound (great game)
badmrbox
Posts: 664
Joined: Oct 27, 2005 14:40
Location: Sweden
Contact:

Post by badmrbox »

^_^

I like the progress :)
Post Reply