View Full Version : SandBox Testing
Ok, I have started a new topic, because this code is getting beyond AI, and creeping into other various elements.
I have no intentions of "This" being the game, or how it is played... "This", is still just a sand-box toy, for testing elements.
I am still trying to get a 3D ship model, and track. (I didn't realize that the track editor didn't export maps yet.) Even as a flat game... this was fun. I was playing more than doing actual code. (Though, I got a lot of that done also.)
Steering is a funny setup, because of the models being -180 to 180 for orientation. I had to add +180, perform a mod, then split it back to the -180 to 180, to mod it again, for "Steer return".
The "Steer return" is about half of the turn value. This aligns you forward, in the direction you hit, so you don't keep spinning around. It still needs some work, but it is playable.
I am thinking about doing the decay, after translation of the KEY MOD, which will show on the next frame-pass. (For now... you add 0.7, than instantly remove 0.3 before translation. Not good. LOL.)
Now I only need to have an indicator setup, to show the direction you "Should" be going... to let you know that you just missed a marker. Which I have also extended to a 20m width, or 10m radius. I am not good at race games. Took me years to master NFS3.
The AI is completely autonomous, with some more generic "Push" code. Gives you something to chase.
No forces yet, only the cheated forces in the controls. No weapons, no walls, no drop-in items, and no sky...
I did notice a cool effect that we may be able to use for sky/water and even has low-overhead... I am just not sure how it will look on other graphics cards. The "Grass" I have as a ground image, when I was moving 0.1 mph, the slow-scroll had a cool GL transform effect. I will attempt to make a skybox with it soon. Not hard to attach the box to the player, now that it is a pivot/player.
ErosOlmi
11-10-2008, 09:38
Again great improve.
Problem is that it is too dark so very soon you get lost.
Petr Schreiber
11-10-2008, 09:52
Worked well for me,
fog is the darkness maker :)
Petr
I am not sure what you say, when you say it is getting dark...
On mine, if I turn the LIGHT on, for the ships... they render backwards... dark under the light, and light away from the light...
I only have a point-light setup... I was not getting any changes with any other lighting. I can turn on "Ambient", but you will have to set it, and tell me what you have it set to. Or send a snapshot... I am going to see if there is anything I can do to make my GL better... I may have knocked it down a notch for spore.
I did change the value of the initial light... (Room was larger)
' -- Create light
TBGL_EntityCreateLight(%sScene, %eLight, 0, %TBGL_LIGHTTYPE_POINT)
TBGL_EntitySetPos(%sScene, %eLight, 0, 450, 0)
Find that near the bottom, the original values of for, TBGL_EntitySetPos(%sScene, %eLight, 500, 1000, 500), should be changed to the above code...
Doesn't do anything on my screen... so I never changed it back... guess that works on your computer. (There is an optional light below, which didn't work for me also.)
Petr Schreiber
11-10-2008, 10:46
Hi Jason,
the racers render odd with light because they have no normal vectors specified.
I think "let it be" because final game will have models, with normals calculated at load time.
To make scene more bright you could set color of ground to 255, 255, 255 as I suggested some time ago.
Petr
If I put it higher than 90,90,90... it begins to "Glow", unnaturally... The attached photo is what I see if I set 255,255,255 for the ground color.
I am sure it is just the way my computer handles open-gl...
(ATI MOBILITY RADEON EXPRESS 200) 128MB.
For what I see on my laptop... This is better than anything else that I have on here with GL settings. I don't expect much from laptops and on-board video cards. They are all chopped-up. If it wasn't for the 2.2Ghz processor, it might look worse! (Turning "V-Sync" on, kills the whole program. It just jumps all over, and the screen actually shears more.)
I should get a snap-shot of the other demo programs. This is a gem compared to the graphic issues those create on my computer. (I just wasn't sure if it was because they were written for the older 1.6 and not 1.7 ThinBasic versions.)
Petr Schreiber
11-10-2008, 11:17
Hi Jason,
the result on your PC is ... correct.
Have a look at original texture, it is very bright.
You disable lighting for ground so I think your output is correct on given settings.
Petr
P.S. Fact is displays of notebooks tend to overbright. For example this forum on laptop at home looks like almost completely white. This has nothing to do with OpenGL.
ErosOlmi
11-10-2008, 11:18
Attached image is what I see in the 3 view modes.
The last one is the one I'm referring when I say it is too dark.
My CPU (see in my signature) is a mobile one but usually much faster than many other desktop one I can compare to.
Ciao
Eros
Wow, are you tricking me... you are out in space... Did you try the light move issue?
I know it is correct coloring, but it does not look right. (Artistically matched for the settings.)
I had to crank it up in my paint program, to combat the the original light issues. It was easier to adjust in the game, than keep going back and forth in the paint program. I figured that I might get the lights working at some point.
Now I am going to go play with the M15 editor, to see what I can create.
ErosOlmi
11-10-2008, 11:24
A suggestion: can you setup a key to switch from one view mode to the other?
Problem is that it is not easy to switch using mouse while you are using arrow keys to drive you car.
I suggest function keys (F4, F5, F6, ...) or use TAB or V key to switch to the next view mode.
Ciao
Eros
A suggestion: can you setup a key to switch from one view mode to the other?
Problem is that it is not easy to switch using mouse while you are using arrow keys to drive you car.
I suggest function keys (F4, F5, F6, ...) or use TAB or V key to switch to the next view mode.
Ciao
Eros
Will do, once I get it down to one camera, on a pivot... That was originally setup for watching the 3000 cars run the points... (Seeing how far they stray.)
You should be watching the road, not sight-seeing in a race! Hehe...
I may keep one camera for a rear-view mirror HUD, and the other for the AI playing. I had the player view moving as you sped-up... it lifted up, and pulled away... but that made it a little harder to move. However, ow I know that it can chase you up hills fine.
Petr Schreiber
11-10-2008, 12:06
Hi Jason,
Now I am going to go play with the M15 editor, to see what I can create.
I recommend using following editors and convert their OBJ export to M15 rather than using thinEdge directly:
Wings 3D (http://www.wings3d.com/) - simple, powerful
Blender - complex, VERY powerful
To get OBJ converted to M15 go for [url=http://community.thinbasic.com/index.php?topic=1418.msg10052#msg10052]OBJ 2 M15 (http://www.blender.org/) tool.
Petr
Sweet... My old version of sketchup exports OBJ files... And it converts perfectly. (Well, if I translate it to triangles it does.)
I have to dissect the output though, I think it is sending both-sides of the triangle. (And I believe all triangles in GL are two-sided, so it is redundant to translate both. If I give one a blank-texture, that should serve as a marker, so I can hand-edit the M15 file.)
Though, I have not tried to export an image-mapped object yet. :-\
Hehe... I already added one ship... Time to add more constants! >:(
Look out TB, I got triangles now! Be afraid... very afraid! ;)
Petr Schreiber
11-10-2008, 23:16
Good to know how SketchUp export works,
thanks for the info :) You are right about the two-sided triangles in GL.
It would be possible to use the way Sketchup does it too, but it would require backface culling. Lets keep it simple.
Petr
Michael Clease
12-10-2008, 01:04
If anyone is using Sketchup V6 (non pro version) here are the plugins for .Obj export and import.
taken from here http://sketchuptips.blogspot.com/2007/09/plugin-index-page.html
Just copy them into the plugins directory and make sure the ruby options are turned on the in the preferences (extensions).
Michael you are a life saver... LOL... I didn't know they had an obj exporter for 6. (Not since google took it over. I figured they just locked everyone out in the free version.)
Not a big deal, for now, to remove the back-sides manually. We have that same problem in IMVU's exporter. (But there, we use both sides some times.)
I changed the key assignments for the camera, but didn't place them on a pivot yet. I spent all night researching more fast-physics, and doing time-demo of codes and functions. (This is the only program I know of, which performs division just as fast as multiplication. Both at mach-12! Usually, that is the first thing I do to a program for speed. turn all common division into multiplication factors. Grrrr... didn't work here... it was already as fast as it could go. Even SQR and ^ are blindingly fast.)
Ok, going back to setup more stuff.