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 / Some more questions...

Author
Message
Hangar18
19
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 18th Jul 2007 03:02
Greetings all, the space sim game I'm working on is coming along very nicely thanks to all your previous help but I'm a little stuck with the following:

1) Is there an easy way to "colour" objects. E.g. If what I want to do is: Make Object plain 100,20,20: Colour object 100, rgb(255,100,100). Is there a command to do this or can you only texture objects to get colour (which means going into PSP and making single colour images).

2) I want to prevent the screen from updating when switching menus. Whats happening presently is this. I go from a "buy equipment" menu to a "buy new ship" menu but for a few millisecs can see all the ship objects being loaded up before the "hide object" command kicks in. I've tried experimenting with Sync but no luck. Can I tell DB not to update the screen like excel can i.e. screenupdating()=false

3) Having a few minor problems with collision detection. I've abandoned using the built in DB collision functions as these operate more slowly than the Dist# = SQRT((X1-X2)^2+(Y1-Y2)^2) approach plus tend to have unexpected and confusing results. However, while the SQRT((X1-X2... approach generall works well for ships of a roughly equal length and breadth, it doesnt of course work so good for long ships (like battelships). Does anyone have any suggestions as to how the SQRT((X1-X2... appraoch might be modified? Ps. I really dont want to go back to trying the DB collision function if it can be at all avoided.

4) I've read a number of posts on backdrops and tiling which partly helped (more from the point of view of what not to do) but have an idea and just wanted to check whether you think the following approach is optimal or at least not totally dumb. Its a 2D space game where you fly from planet to planet and the backdrop is a plain with a space background textured on it. The problem I'm trying to get round is that if the your ship travels too far, you hit the edge of the plain which isnt good. Stretching the plain makes the backdrop image less clear so my thoughts were to create 9 plain tiles or maybe even 27 if needed. Obviously the backdrop image needs to be seemless but is this a sensible way to go or could anyone recommend a better approach?

Thanks for any help you can provide with the above.
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 18th Jul 2007 06:15 Edited at: 18th Jul 2007 06:16
[1] the color object command will change an object emissive colour, you can also affect the colour of the object by affecting the ambient colour and switching it on to specific models.

[2] autocam off and autocam on, prevents the camera from moving to the loading object and makingit visible while loading.

[3] distance functions were a problem with me as well. I covered many here and got great contextual help. http://forum.thegamecreators.com/?m=forum_view&t=93279&b=1

[4] scroll object texture will scroll a texture along the u or v of a 3d plain, if the texture was seamless with the offset filter in photoshop on the horizontal dimension then that might work.
[4.1] rotating a large sphere could also achieve a fluid multi directional backdrop.

Comrade Robski
20
Years of Service
User Offline
Joined: 12th Sep 2005
Location:
Posted: 18th Jul 2007 16:27
An additional comment on question [1]

I find the COLOR OBJECT command can cause a big drop in performance, especially if you use it to colour lots of objects. A better way is to make your own colour textures. They only need to be tiny:



and question [4]:

indi's idea will work - you could also investigate the SCROLL TEXTURE command - move the background plane with the player object, and scroll the texture to simulate movement.
Hangar18
19
Years of Service
User Offline
Joined: 13th Mar 2007
Location:
Posted: 19th Jul 2007 00:56
This is excellent advice - thanks guys! Will check it out hopefully tonight. I get what your both saying abou the scroll texture command and am particularly optimistic this will overcome what I thought might otherwise be a major problem.

On the colour object issue, will keeping say 10 coloured images (cant imagine me needing more) stored in memory reduce performance much? My guess is it wont and is bound to be a better way to go than colouring objects.
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 19th Jul 2007 03:41
Comrade Robsk is correct on the performance hit for color object with classic.
the scroll object texture might also leak with memory in classic as well.
I would print the fps and video memory to the screen in a test to see if those issues still exist.

Login to post a reply

Server time is: 2026-07-05 20:22:10
Your offset time is: 2026-07-05 20:22:10