Tower defense on Msx

Page 5/7
1 | 2 | 3 | 4 | | 6 | 7

Par Leo

Paragon (1236)

Portrait de Leo

28-12-2010, 17:57

Par ARTRAG

Enlighted (6445)

Portrait de ARTRAG

28-12-2010, 21:37

Nice work!

Par Leo

Paragon (1236)

Portrait de Leo

28-12-2010, 23:11

thks !
next step is to define sprites with a bar for hit points and make them die when count =0 , not big deal
and after that define the rounds , just a little more time
finally improve gfx , boring to me
and ultimately add sfx
long way then !

Par RobertVroemisse

Paragon (1261)

Portrait de RobertVroemisse

29-12-2010, 08:49

Great work! Love it.

Par Leo

Paragon (1236)

Portrait de Leo

30-12-2010, 23:11

thks as well , now with hit point bar on monsters :
http://www.youtube.com/watch?v=Yqbo3JKdWeo

Par Hrothgar

Champion (479)

Portrait de Hrothgar

31-12-2010, 09:26

What is the greatest bottleneck in speed on MSX2, the calculations or the actual sprite manipulation? I recall that putsprite is really slow compared to direct VDP commands and vpokes but that problem might as well be optimized already in this example.

Par Leo

Paragon (1236)

Portrait de Leo

31-12-2010, 09:44

regular put sprite is used.
this is turbo basic or xbasic / basic kun
i think calculation are slow , sometimes i use operator like "*2" which could be optimized in asm .
i alsonoticed that at the begining i was using single/doubles forvariablesand using integers speeded
up the execution.
the main loop has two "for" loop with "if then else" , like this:
for monster=1 to 9
for tower =1 to 5
- three if statement
- tower to monster distance test, can be slow
- some gosubs if some condition true
next
next

i use "on key gosub" and "on interval gosub" which may slow down turbo basic ( though i have not noticed it)

Par Edwin

Paragon (1182)

Portrait de Edwin

31-12-2010, 11:19

You could test if four "pokes" gives you a substantial gain over put sprite. Especially in basic kun this should compile to something that uses nearly no time at all. If that works, then you could use a 128 byte memory buffer for the sprite attribute table and have a small ML routine upload this to vram each vblank (see screen2 upload code on my site for an example implementation).
If it doesn't give you any gain, then you need to optimise other things. Like for instance your distance calculation.

Par Leo

Paragon (1236)

Portrait de Leo

31-12-2010, 15:41

you mean 4 vpokes ? ok ill try .

Par ARTRAG

Enlighted (6445)

Portrait de ARTRAG

31-12-2010, 17:11

you can do one vpoke and 3 out (&h98,value)
this saves even more
but if you write all spite in sequence you can do one vpoke and a bunch of outs saving a lot of cpu time

Page 5/7
1 | 2 | 3 | 4 | | 6 | 7