Gamestudio Links
Zorro Links
Newest Posts
How to Change Multiplier
by vicknick. 06/02/23 03:27
How to buy tomorrow at open?
by vicknick. 06/02/23 03:19
Adding Position to Current Trade
by vicknick. 06/02/23 03:09
Unable to change multiplier of contract
by vicknick. 05/30/23 06:56
Wrong Definition of Sharpe Ratio in Zorro?
by vicknick. 05/29/23 06:32
Backtest strategy on bitcoin/crypto
by JamesHH. 05/26/23 04:36
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (vicknick, 7th_zorro, Quad), 1,012 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
BInnacle, androsa, XquicksnowX, danishinvest, Trail
18942 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Suggestion for a new terrain function. "ent_morphterrain" #383921
09/27/11 09:49
09/27/11 09:49
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Just an idea I had while brainstorming on a future project.
Please excuse the sales pitch, but I want to explain the reasoning...


In the BEGINNING... we were given ent_create, and we felt it good.
Later ... came ent_morph, and memory became more managable and flexible.

NOW ... we have ben granted ent_createTERRAIN, and our world is more managable.
So now... I feel ... we need ... we want ... I want ... ent_morphterrain!

The ability to take an existing terrain entity and change its size.
That is either its cell 'size', or its overall width or length(in cells).
Much like the "Change Terrain Vertices" funcion in MED, except in-game...

[EDIT]Another bonus would be if it could allow you to re-locate an existing
terrain to a new XYZ co-ordinate, without needing to remove and re-create...


Last edited by EvilSOB; 09/27/11 13:25.

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Suggestion for a new terrain function. "ent_morphterrain" [Re: EvilSOB] #384099
09/29/11 10:29
09/29/11 10:29
Joined: Jul 2000
Posts: 27,947
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,947
Frankfurt
An engine function for changing the number of terrain vertices had no advantage over recreating the terrain in lite-C. It would be pretty much the same code.

Re: Suggestion for a new terrain function. "ent_morphterrain" [Re: jcl] #384114
09/29/11 13:38
09/29/11 13:38
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
How about the fact that re-creating a terrain consumes memory?

And if done repetitively you can comsume all available memory...

If my understanding is wrong in this case, can you please contribute
to THIS THREAD...
Just to point out where I/we are going wrong and perhaps pointing us
in the correct direction.
The latter stages of that thread are more to the point, but it's
probably worth your time to read from the start, so you can see the
'thought proccesses' that led us to those later points...

Thanks dude.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Suggestion for a new terrain function. "ent_morphterrain" [Re: EvilSOB] #384121
09/29/11 14:25
09/29/11 14:25
Joined: Jul 2000
Posts: 27,947
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,947
Frankfurt
Yes, it consumes memory. But this is due to the level cache and would be no different with an engine based function.

You can use ent_purge to clear removed terrain from the video memory, and level_free to clear it from the level cache.

Re: Suggestion for a new terrain function. "ent_morphterrain" [Re: jcl] #384128
09/29/11 16:31
09/29/11 16:31
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
And thats why Im after the ent_morphterrain function!

Because ent_purge only clears the video memory, and
clearing the level-cache removes EVERYTHING.

The reason I ask is because I want to be able to MORPH terrains so
I can build a supra-large terrain out of a 'swarm' of smaller, mobile terrains.
Im currently developing this using terrain-like entities, but true terrains
are far less cpu-hungry.

(have a quick LOOK at the other thread I linked earlier, it explains in more detail)


Oh... And thanks for listening dude.


{EDIT] Hell, I would be happy with just the ability to MOVE a terrain,
and adjust the size of its cells, and re-center its origin with this function,
even if I cant have the ability to change the number of cells..

Last edited by EvilSOB; 09/29/11 19:54. Reason: second thoughts

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Suggestion for a new terrain function. "ent_morphterrain" [Re: EvilSOB] #384196
09/30/11 14:12
09/30/11 14:12
Joined: Jul 2000
Posts: 27,947
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,947
Frankfurt
Moving and scaling should be possible by just changing the terrain vertex positions with ent_getvertex/setvertex. The examples only show how to change the height, but it should also work for x and y. I haven't tried it yet however. Post here if you get problems and I'll look into it. Be careful not to distort the terrain - every cell must stay rectangular, otherwise chunking and collision detection won't work anymore.

Re: Suggestion for a new terrain function. "ent_morphterrain" [Re: jcl] #384204
09/30/11 17:14
09/30/11 17:14
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I am already aware you can adjust the X and Y, but Im not going to go there.

Because with the needs I have, these vertices may be getting moved by
500,000 quants or more from their origin, and I think thats getting pretty ugly.
And then there is the huge numbers involved in the mathematics, then we are just
asking for trouble in trying to keep the vertices aligned along the edges of
of neighbouring terrains...

Just too many things to go wrong doing it that way...

[EDIT] BTW, Im not using any chunking or LOD...



Last edited by EvilSOB; 09/30/11 17:16. Reason: BTW

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

Moderated by  aztec, Spirit 

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