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 / Sparky's crash when object id is >100000?

Author
Message
AriEf
14
Years of Service
User Offline
Joined: 30th Nov 2009
Location: Indonesia
Posted: 22nd Jun 2015 18:48
hello, after searching in forum and didn't find why my game's crashes, i accidently found what makes my game crashes

here is code when still crashes


here is code that not crashes



(ignore that weird variable name and that weird gravity algorithm, it just for test lol)

why when i change objectID of terrain.x into 50001 it not crashes? :/
sorry for my english hehe

AI Game Studio
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Jun 2015 21:40
Quote: "why when i change objectID of terrain.x into 50001 it not crashes?"


I believe the maximum object ID is hardcoded to be something like 65000 which is near 65536 (= 2^16). Probably something to do with the size of the binary search tree used in the collision algorithm.

On my machine I get a crash with an object ID of 65535 but not with 65534. So my guess is that if you keep all your object IDs well below that value you should be OK.

I haven't used Sparky myself - other than testing his code this evening. Perhaps someone else knows the definitive explanation?




Powered by Free Banners
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Jun 2015 19:26 Edited at: 23rd Jun 2015 19:27
Just to add... my thought is that the original DarkBASIC had a limit of 65535 objects and that Sparky's had been originally developed with a 1:1 object to collision object ratio in mind.

Enjoy your day.
AriEf
14
Years of Service
User Offline
Joined: 30th Nov 2009
Location: Indonesia
Posted: 25th Jun 2015 10:32
okay, thanks for replying

AI Game Studio

Login to post a reply

Server time is: 2024-03-28 09:31:22
Your offset time is: 2024-03-28 09:31:22