Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,393 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
3000 moving objects? No problem! #360451
02/24/11 01:42
02/24/11 01:42
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I've made a quick test with 3000 moving objects (primitives without skin, I know), they don't use collision detection but adopt nicely and smoothly to the terrain:



Download source code with example here!

Instead of c_trace I interpolate between the 4 surrounding terrain vertices. The manual suggests you could use ent_getvertex and ent_nextvertex but that alone results in choppy movement.
The download includes two examples, 'level.c' and 'level_optimized.c' (all entity movement in one loop). With the latter file I only have 2.3ms script execution time on my 4-year-old notebook which I think is a pretty nice result.
Have fun experimenting with it (if you like to)! If you don't know how to use the height interpolation in your code, a game with a smaller scale is probably the better choice for you.

(Can be moved to User Contributions.)


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: 3000 moving objects? No problem! [Re: Superku] #360455
02/24/11 02:51
02/24/11 02:51
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Jede Woche was neues von dir. Glaube du hast einfach zu viel Zeit wink

Have 56 fps on my laptop, nice. (2.0ms for functions)
Good idea with the interpolation, thanks.

Last edited by Widi; 02/24/11 02:53.
Re: 3000 moving objects? No problem! [Re: Superku] #360456
02/24/11 02:52
02/24/11 02:52
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Brilliant! That's efficiency right there. Now please remake Age of Empires II in 3D with a higher unit cap laugh

kthxbye

Jibb

EDIT: PS: I played with the numbers a bit and got about 7500 entities before the frame rate started to slip below 60 (Core i7 950 CPU)

Last edited by JulzMighty; 02/24/11 02:56.

Formerly known as JulzMighty.
I made KarBOOM!
Re: 3000 moving objects? No problem! [Re: JibbSmart] #360458
02/24/11 05:01
02/24/11 05:01

M
mercuryus
Unregistered
mercuryus
Unregistered
M



Ohne Collision und bei geringer Polygonzahl ist das kein Wunder.
Dachte, dass währe bekannt...

Re: 3000 moving objects? No problem! [Re: ] #360469
02/24/11 08:52
02/24/11 08:52
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany


funny stuff......arggggg threre are thousands of ants grin

1.3ms & 60fps on 2 year old lappy


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: 3000 moving objects? No problem! [Re: gri] #360473
02/24/11 09:04
02/24/11 09:04
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
This is incredible laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: 3000 moving objects? No problem! [Re: 3run] #360476
02/24/11 11:27
02/24/11 11:27
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
Its a very useful contribution! Until now, I've always used trace for such movement. Now I can just take a look at your sourcecode and don't have to experiment with getvertex etc.

Thanks a lot!

Re: 3000 moving objects? No problem! [Re: SchokoKeks] #360488
02/24/11 14:26
02/24/11 14:26
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Thanks!

Quote:
Ohne Collision und bei geringer Polygonzahl ist das kein Wunder.
Dachte, dass währe bekannt...

Versuch es und benutze c_trace, um die Höhe über dem Terrain zu bekommen. Dann verbrauchen 100 Entities sicherlich die gleichen CPU-Ressourcen.
Und was hat die Polygonzahl überhaupt damit zu tun? Ich glaube, du hast überhaupt nicht verstanden, worum es hierbei geht.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: 3000 moving objects? No problem! [Re: SchokoKeks] #360490
02/24/11 14:29
02/24/11 14:29
Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
xxxxxxx Offline
User
xxxxxxx  Offline
User

Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
when i was looking on the objekts(ca. 9000) i got 37 fps when not i dad 75-70 fps! i dont know why the simple objekts slow down the grafiks(even with 4 poly models)!
xxxxxxx


Es ist immer wieder erstaunlich, dass Leute die riesen Scripte schreiben die einfachsten sachen nicht können zb. mich mit SIEBEN x zu schreiben! tongue
Re: 3000 moving objects? No problem! [Re: xxxxxxx] #360491
02/24/11 14:32
02/24/11 14:32
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
9000 draw calls.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Page 1 of 3 1 2 3

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1