Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Advanced Terrain known problems

Author
Message
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 18th Sep 2015 10:25
Can someone list the known problems About the advanced terrain? problems that crash the game I mean.

In my game, loading the main Island or the labirinth Island (which both do not use the advanced terrain, just normal objects) they never crash, but very often I see that the game is crashing loading zombie Island (which use the advanced terrain).

this is the code I use to make the terrain:



I thought I was almost ready for the release of the game but these kind of bugs are turning me crazy.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th Sep 2015 14:18
Hmmmm, I wonder if that 'GET OBJECT SIZE Y' command is confusing matters. Although AT uses objects, it might have issues due to the way it hides and shows parts of the terrain... maybe an idea to omit that for now, and if it is at fault, maybe just scan over the whole terrain in tile sized chunks with the GET TERRAIN HEIGHT command, and gather the maximum height value that way instead.

Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 18th Sep 2015 18:31
I will try, btw this is the code I use to fix the character's height, in the loop:



Another weird thing is, if that level crashes, it crashes just after finishing to load, if it loaded and didn't crash the first 5 seconds then it will never crash later when playing the level
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 18th Sep 2015 19:33
I use the Get Object Size commands all the time with Advanced Terrain and never had an issue. Testing with a 256x256 heightmap, I get a Runtime Error; Index count over 65k - make split value higher.
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 18th Sep 2015 20:06
I will try that, thank you, btw, my heightmap is very small (128x128)
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 18th Sep 2015 21:22
for some reason the more you increase the split value the more the fps are affected and the game slows down.

I used to set 2 just because of this reason, setting it to 16 it seems to be ok and I don't know if is that or something else but it seems to be more stable compared to the value "2".

If I set it to 32 it is extremely slow.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 18th Sep 2015 21:30
That is odd. The help file states the opposite. Increasing the split value should give better frame rate.
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 18th Sep 2015 21:42
Before to use the terrains I used to play with the variables and looked always at the fps, I am 100% sure that when I used higher values for the split thing I got worse performance, and with low values I got high performance.

As said in my last message, with 32 value it is unplayable because the fps are very very low
Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 19th Sep 2015 00:26
I can't remember the specific context, but several years ago I was getting into a pickle with the Get Object Size command. Ian M recommended preceding it with the Calculate Object Bounds command, and the problem vanished. Give it a try.
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 19th Sep 2015 01:00
Ok I will give it a try thanks, btw I don't understand why in the code I am using it says object size y(2,11), the second value in the help file it seems to be a boolean, so 0 or 1, I don't understand why it is wrote 11.

I have taken the code to make the terrain from green gandalf if I don't wrong, who helped me to make a terrain with "fading textures", that' why I don't understand some of the code (like converting fvf formats etc)
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 19th Sep 2015 08:28
I don't want to talk too early but maybe I got it.

Changing object size y(2,11) to object size y(2,1) and adding calculate object bounds seems to have fixed it (I hope, I went from the main Island to the zombie one like 7-8 times forward and back and no crashes).

Thank you very much Jeff! You have been very helpful!

I have already uploaded my game on steam and requested some betakeys for testing!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Sep 2015 16:45
Quote: "Ok I will give it a try thanks, btw I don't understand why in the code I am using it says object size y(2,11), the second value in the help file it seems to be a boolean, so 0 or 1, I don't understand why it is wrote 11.

I have taken the code to make the terrain from green gandalf if I don't wrong, who helped me to make a terrain with "fading textures", that' why I don't understand some of the code (like converting fvf formats etc)"


Can you point me to the thread so I can check?



Powered by Free Banners
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 20th Sep 2015 19:50 Edited at: 20th Sep 2015 19:51
I don't know why but I can't find the post anymore, it was one where I requested help to do "fading textures" so that you have grass on the base and rock on the top of the object/terrain.

By the way the game still crashed a couple of times when going to zombie Island, so the problem is not fixed yet


EDIT: post found:

http://forum.thegamecreators.com/?m=forum_view&t=214416&b=1
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 20th Sep 2015 20:15
This kind of crashes is very frustrating, the RAM usage in that level it's also low, around 300 MB, while in the main Island it uses 760 MB and never crashes.
If was a "Always crash" thing, I could have changed 1 thing per time to detect what it is causing the cras, but this crash is completely random, sometimes you load the level, and as son as the loop starts it crashes, other times you start walking or running and it crashes after 5-10 seconds, other times you can play the level without crashing at all.
The crash happens Always in the first seconds after the level loads (but Always AFTER it loads, when the main loop it's already started)
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Sep 2015 00:24 Edited at: 21st Sep 2015 00:37
I can't find any code containing the string "object size y" in that thread.

Could you show me the code which contains that fragment? I might recognize it. It certainly should have a Boolean second argument, i.e. 0 or 1 as you say. If it was one of mine I'd like to get it corrected. Thanks.

Edit Found it, sorry.

But the only reference is in this section of the code:


It does not use "object size y(1,11)". If that's the code you're using then you must have added the extra 1.



Powered by Free Banners
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 21st Sep 2015 00:49 Edited at: 21st Sep 2015 00:49
This is the code I use to make the terrain:



also, even if is off topic, I have requested in another post how to add fog in a shader (the evolved normal map exactly), do you know how to do that GG?

I know that his Relief Map shader use it and having the fog it makes objects on distance look smoother, I wish to have the fog on the normal map shader as well
Adrian
20
Years of Service
User Offline
Joined: 11th Nov 2003
Location: My Living Room
Posted: 21st Sep 2015 22:34
When you make your terrains, be sure to check them right to the edge because,as I recall, two of the edges are drawn incorrectly - in fact they are invisible (but they are there). I think this happens once a terrain has reached a minimum size.

One of the many bugs that made me buy Blitz Terrain (that has its own problems too)
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 21st Sep 2015 22:45
Yes I have noticed this, but I didn't think it could trigger crashes, I thought I was doing something wrong
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 25th Sep 2015 03:13
It seems to still crash randomly, I still can't spot what the problem is...
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 25th Sep 2015 22:14
Noobish question for an unlikely fix:

Have you tried to declare as globals at the top of your code all the variables present in that snippet..?
Another thing:
Pass "object size y(2,1)" to like a objheight# (declared global) variable and use that instead of using the actual calculation.
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 25th Sep 2015 23:15
Ok I will try it and see if it still crash, thank you
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 26th Sep 2015 00:40
Sadly it didn't fix the problem
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 26th Sep 2015 19:30
Not much more comes to mind..
If you have (as you should) "update terrain 2" in the main loop try to rem it out and see what happens.

Another try could be to save the terrain as .dbo object and use it with a load object command..
You may loose all the tricky fine tuning though.
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 26th Sep 2015 21:59
I actually don't use update terrain, what do I need to update? I only check the terrain height for the player y position
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 26th Sep 2015 23:13 Edited at: 26th Sep 2015 23:14
UPDATE TERRAIN

This command wasn't mentioned in the original help file, but according to the original example it must be called each loop to "let the terrain handle some internal work". It helps in culling the terrain.
Syntax
UPDATE TERRAIN
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 27th Sep 2015 03:44
added that command, after the 3rd time I was going from the main Island to zombie Island it crashed, after about 2-3 seconds I was running with the character
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Sep 2015 15:29
Quote: "after the 3rd time I was going from the main Island to zombie Island it crashed"


Are those two islands two different Advanced Terrain objects? If so, what method are you using in code? In other words are you repeatedly loading/destroying terrain objects or something else?


Powered by Free Banners
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 29th Sep 2015 17:51
I ve used the advanced terrain only in the zombie Island (and thanks god just there), in the main Island and labyrinth Island I have used a normal dbo object
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 6th Oct 2015 23:00
I am not sure 100% yet but I think I have spotted the problem.
It wasn't the advanced terrain crashing the game: the problem is that when I was cloning the zombies from the 1st one, changing textures to make them different, I was also applying again the effect (normalmap shader) to them. Applying an effect to a cloned object that has already that effect applied seems to make this problem.
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 7th Oct 2015 07:42
Great news then
Let's keep fingers crossed.
Cheers
Scorpyo

Login to post a reply

Server time is: 2024-04-25 15:36:56
Your offset time is: 2024-04-25 15:36:56