[java] i don't understand java

Started by
20 comments, last by mill-o 22 years, 1 month ago
yo. my game is shitty and i don''t know why. the thing is that i don''t get how java works. it runs good on some systems, and terrible on some systems. sometimes it''s jerky as hell, sometimes not. on some computers there is a giant lag sometimes (gc perhaps?). obviously i''m doing something wrong (threads, graphics, everything?) if someone has a few mins over and will have a look at my code, i''d appreciate it. since it''s too much to post here, download the source at http://mill.3dfxsweden.net/temp/src.rar for a playable version, http://mill.3dfxsweden.net/games/race
_______________________ http://mill.3dfxsweden.net
Advertisement
Worked pretty well for me. I averaged around 50fps on a dual p2 333 gf2mx. A couple times, I don''t know if it is gc or something else, I got a second or so long pause and everything went to hell the second time it happened and the applet froze.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
Seems to run perfectly on the PC i''m at. PII-400 with 256 MB ram, and a crappy ATI graphics card(rage 64).

==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
thanks for trying it out. i''ve had a fair amount of testers, just nobody seems to be unemployed (read gots lots of free time to review the code) :/

i''m glad it went smoothly on yer systems. i got a tip about the gc at javagaming.org. they said i didn''t give the gc enough time to run, so instead it runs less frequently but to compensate it runs longer. i need to make it run more frequently by limiting the fps and by letting the threads sleep.

for the lazy ones, most of you that is, i''ll post pseudo code or atleast just post the most crucial code, how''s that? i''ll do that tomoz (or later tonight if i can''t sleep).

thanks for trying it out. i''ve had a fair amount of testers, just nobody seems to be unemployed (read gots lots of free time to review the code) :/

i''m glad it went smoothly on yer systems. i got a tip about the gc at javagaming.org. they said i didn''t give the gc enough time to run, so instead it runs less frequently but to compensate it runs longer. i need to make it run more frequently by limiting the fps and by letting the threads sleep.

for the lazy ones, most of you that is, i''ll post pseudo code or atleast just post the most crucial code, how''s that? i''ll do that tomoz (or later tonight if i can''t sleep).

_______________________ http://mill.3dfxsweden.net
It runs _mainly_ ok on my computer.
Time to time there comes a "lag" bursts, when car(s) jump to another position.

I have had very similar problems in my own (Threaded)applets, which have been done exactly right, so it''s not bad coding necessary.

btw. my computer: AMD 1200@1350, Voodoo3, 256mb.
I think it might be less jerky if you increase the sleepTime to 50. Don''t quote me on that, though.
i've been fiddling a little with high-res timers and some other stuff and here it works a little better now.

http://mill.3dfxsweden.net/games/race/index.html

note that it's a bit slow right now, just need to increase a few parameters. that's not important right now. i'd like to know if those who thought it performed badly think it's better know.

got lots to improve though. thank's in advance.

Edited by - mill-o on February 20, 2002 4:48:54 PM

Edited by - mill-o on February 20, 2002 4:50:06 PM
_______________________ http://mill.3dfxsweden.net
I don''t know what you did but it wasn''t good. I got 0.6fps before IE6 crashed. It was going nuts on my harddrive. I don''t know how you managed that since I had 80megs of physical left.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
basically all i''ve done is to use a high res timer and a little less temp variables and stuff like that.

it''s disturbing that it''s WORSE than before. those who had a louse 15 fps on a cel600 now get 35 fps (i''ve limited the fps to 35 and sleep more so that the gc gets happy).

i even tried it on an old sun ultra sparc 1 (167 Mhz, 128 Mb ram, creator gfx card) and i got ~18 fps.

about 300 people have tested it and only a few say something. thought i''d get a little more feedback :/

GKW: what OS and what vm are you using? 0,6 fps is really shitty so i must be doing something wrong

(yah i know, people keep telling me to NOT rotate sprites in real-time, but disabling that on my system have NO effect at all. i''ll change that when i get time)
_______________________ http://mill.3dfxsweden.net

This topic is closed to new replies.

Advertisement