Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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 (AbrahamR, 1 invisible), 858 guests, and 6 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 4 1 2 3 4
Dynamic Tree Solution #53543
08/29/05 04:45
08/29/05 04:45
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Hi all,

I am developing a car game in big city. My city has many map entities and small models. Because of my small models /over 3000 trees, 2000 lights,.../ my FPS is going down and i decided to write scripts for these small objects.

Now my level has only few small objects /50 trees, 30 lights ,.../ and FPS is good.

My solution is to create few models at startup and change their positions to another tree locations if they go out of camera.

I think this solution will help many people who is making outdoor game.

Here is my code : dynamic_tree.rar

1. You have to place all trees at correct position in your level and build it.
2. Include <trees.wdl> to your game.
3. Press F2 to save all tree locations to <trees.ini> file.
4. Delete all trees from your level and build level.
5. call Read_Trees_Ini function in your main function after load level.
6. Run


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: Dynamic Tree Solution [Re: Olzii] #53544
08/29/05 06:20
08/29/05 06:20
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline
Expert
EX Citer  Offline
Expert

Joined: May 2002
Posts: 2,541
Berlin
Thatīs a good idea. Is the angle and scale saved too?


:L
Re: Dynamic Tree Solution [Re: EX Citer] #53545
08/29/05 06:32
08/29/05 06:32
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Yes, you can save angle and type of objects. I saved (x,y,z,pan,type) for city lights. But in this code it does not exist. You can add it easily.

I have choosed random values for tree's pan and scale in this script.


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: Dynamic Tree Solution [Re: Olzii] #53546
08/29/05 10:17
08/29/05 10:17
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
Great idea.


Follow me on twitter
Re: Dynamic Tree Solution [Re: Olzii] #53547
08/29/05 10:52
08/29/05 10:52
Joined: Aug 2003
Posts: 153
Germany, Dresden
lolek Offline
Member
lolek  Offline
Member

Joined: Aug 2003
Posts: 153
Germany, Dresden
Thanks for that usefull script.
A really good idea!


on my HP: simple dialogeditor 2.0, particleeditor with children mdl Models mdl2 mapping tree modeling terrain modeling
Re: Dynamic Tree Solution [Re: lolek] #53548
08/29/05 15:27
08/29/05 15:27
Joined: Jun 2005
Posts: 656
G
Grafton Offline
User
Grafton  Offline
User
G

Joined: Jun 2005
Posts: 656
Thanks for sharing this Olzii, nice contribution to the community!


Not two, not one.
Re: Dynamic Tree Solution [Re: Grafton] #53549
08/29/05 16:40
08/29/05 16:40
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Sounds like a fantastic solution for an important problem! Thanks a lot!

Re: Dynamic Tree Solution [Re: Pappenheimer] #53550
08/30/05 02:57
08/30/05 02:57
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Thanks all,

I am happy to help people.


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: Dynamic Tree Solution [Re: Olzii] #53551
08/30/05 03:04
08/30/05 03:04
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Thanks bupaje,

Bupaje sent me PM about James has another good idea.

First, I have placed all my trees at my level . After testing i have wrote this script.

James' s idea is not to place all trees to level. It is a BIG job. We can create just TREE_MAP picture that has tree positions. Another Good Idea ! It will save time.


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: Dynamic Tree Solution [Re: Olzii] #53552
08/30/05 23:53
08/30/05 23:53
Joined: Jun 2005
Posts: 656
G
Grafton Offline
User
Grafton  Offline
User
G

Joined: Jun 2005
Posts: 656
Code:
 
James' s idea is not to place all trees to level. It is a BIG job. We can
create just TREE_MAP picture that has tree positions. Another Good Idea !
It will save time.



That does sound good! Any idea on how it could be done though?


Not two, not one.
Page 1 of 4 1 2 3 4

Moderated by  adoado, checkbutton, mk_1, Perro 

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