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 Discussion / Optimization

Author
Message
lophyte
21
Years of Service
User Offline
Joined: 1st Jan 2004
Location:
Posted: 3rd Jan 2004 12:30
This is my first run at making a game in DB, and I'm working on an FPS. So far everything works well, except I'm using cubes for the walls (the engine reads characters from a text file and places the cubes in 3D space accordingly) which also works pretty well, except for when I enable object collision and have 100+ cubes created.. this of course causes an exponential decrease in framerate. Is there any other more efficient method/way of optimizing the code that would prevent this using up of resources?
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 3rd Jan 2004 13:18
You can use math collisions instead, since you are only using cubes. Try doing a search for it in the forums.

People? I hate people. People are stupid.
lophyte
21
Years of Service
User Offline
Joined: 1st Jan 2004
Location:
Posted: 3rd Jan 2004 13:32
You mean coding the object collision stuff myself? I suppose that would work.. I'll give it a shot.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 4th Jan 2004 01:58
I have yet to understand all that collision mumbo jumbo. can you explain how to make this math collision?

Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 4th Jan 2004 02:48 Edited at: 4th Jan 2004 03:07
Mayor Payn, math collision is easy, here's a small function that checks for collision with a box:




Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 4th Jan 2004 03:40
Basically, you could put that into a function that calculates the collisions for each box you use in your game. Should be no problem for you if you managed to make levels by positioning boxes read from a text file.

People? I hate people. People are stupid.
Sjakie
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: Netherlands - Delft
Posted: 4th Jan 2004 11:18 Edited at: 4th Jan 2004 11:19
But... this only works with boxes that are rotated 0,90,180,270 or 360 degrees, else it creates wierd collisions

Juzt a dude who likez progging
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 4th Jan 2004 13:57
Jo Sjakie, I made that code in 3 minutes, give me, lets say, 90 minutes and Ill be back with box sphere cone and cillinder collision + all angles and it will stay FAST


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 5th Jan 2004 14:20
90 minutes are up. gimme teh codez.

What isn't remembered, never happened.
Memory is merely a record... You just need to rewrite that record.
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 5th Jan 2004 14:37
lol

I am mischeivious
RoooooOoooooKoooooKoooooRoooooOoooooKoooooKooooo!
Travis
21
Years of Service
User Offline
Joined: 9th Nov 2003
Location: West Aust.
Posted: 8th Jan 2004 06:23
just make it so every x amount of units (based on the size of ur walls and stuff) that u move ur 3d char in the north direction add one to a counter and in the south take one from the counter and the same for east west with another counter and u get ur x/y pos for the 3d char in a 2d grid world and check this number against ur 'map file' to see if ur char is on a wall or not .... i used this to make a topdown shooter so it had map tiles and collision based on a grid but the character movements and everything is still smooth

p.s. if u need some more detailed info just ask

Login to post a reply

Server time is: 2025-05-22 08:39:10
Your offset time is: 2025-05-22 08:39:10