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 / DarkPro's - What do you think?

Author
Message
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 7th Nov 2009 13:18 Edited at: 7th Nov 2009 13:19
Hello everyone!

A while back I said I'd post my sync optimizer function, so I decided to do that now. Attached is the function with an example.

cometSYNC()

What it does is it counts the loops that have actually been processed in one second. Then it checks how many loops are missing, and then skips the synchronization of that amount of loops evenly spread in the next second. This way, you can get the game to always run at 60 FPS, even if you have like 500 objects in it.

The function may take up to 10 seconds to stabilize, but on my computer it only takes 3 seconds. This might be quite useful to add to our game.

The return value is the FPS rate, and the sync rate value must be specified as an integer value.

SYNTAX

return value = cometSYNC(sync rate)

You should replace any "sync" commands with "cometSYNC()".

Enjoy!

TheComet


Make the paths of your enemies easier with WaypointPro!

Attachments

Login to view attachments
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 8th Nov 2009 00:09
Nah latch made a comment about clutter of GUI a couple posts back and he also mentioned my Menus.

New Site! Check it out \/
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 8th Nov 2009 00:43
@Comet - Nice, could you change it to make it compatible with DBPro too? It says that 'timer' is an invalid variable, and if I change it to just 'time' it seems to mess it up, though I don't know why..
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 8th Nov 2009 01:14
did you replace all instances of the variable to time instead of timer?

to do so go to Edit>>Replace
type timer in the find box and time in the replace box and press replace all.

New Site! Check it out \/
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 8th Nov 2009 04:09
Yes, I did, but it just returned '1' for the cometSync rate...
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 8th Nov 2009 05:40
Oh. idk why then.

New Site! Check it out \/
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Nov 2009 12:00
No worries, I'll convert it. I have an updated version where you can set how many times it should update the sync rate.

TheComet


Make the paths of your enemies easier with WaypointPro!
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Nov 2009 17:17 Edited at: 9th Nov 2009 17:19
@Digger412
Are yu giving the terrain a go?

And could you give the barrels/drums another go? Texture-wise, it would be good to have some realism. If not barrels, then how about a few wooden crates - again, textures are very important - but not too big (256x256 as a standard and maybe even up to 512x512) If you can get away with small good looking textures, than that would be great.

@Obese87
Any ideas for a menu system?

@All
I was just thinking maybe a little out of scope for where the project is now, but does anybody have any ideas how to create a real time intro type of movie in DBC where there may be a car driving down a dirt road, there would be shots from the interior of the car, as well as from the exterior? I say real time and in DBC so that the look of the "movie" has the same look as the game; as opposed to a rendered avi type movie from a 3d app. Just wondering if anyone has tried this type of thing or maybe has some ideas on how to pull it off.

And also, I'm moving a little slow on the collision, but I am moving believe it or not.

@Dark Dragon
If you are still around, I'd like you to take a look at your line of sight function that you did a while ago. I'd like for you to implement using MAKE OBJECT COLLISION BOX so that the x,y, and z coordinates can be returned if there is collision with another environmental collision area. Part of the key for this is efficiency and general accuracy. Try and rework it to be as fast as possible.

@No Time to Code
If you have time, try and work on the outside waypoint creation system. The idea was to have many possible paths that lead to the windows of the house from the outside (from the farthest reaches of the terrain). Robert The Robot hasn't made a peep for a while so if you can, do you mind working on this?

@TheComet
Thanks for the code.

Enjoy your day.
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 9th Nov 2009 17:57
I don't have any experience with creating real time intros but I think it would be a great feature to add to the game.

I have started on a waypoint creation system.

Done
Use mouse to lay waypoints on matrix
Move and delete waypoints
Save waypoint data (XYZ coord) to .dat file

To do
Work with terrain model instead of matrix
Load saved data back into waypoint editor for further editing
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Nov 2009 07:45
Quote: "I have started on a waypoint creation system."

Great.

You mention using a matrix and also a terrain. Just my opinion but it might be more flexible just to base it on world coordinates. That way you don't have to rely on a defined grid. Any grid can be defined by world dimensions.

And in general, if a character or an object are traversing over terrain, then the y value or height might be left up to the collision or ground height code. Using the y value in a waypoint may be superfluous or even a hinderance depending on how the character moves from 1 point to the next. A lower to a higher elevation change isn't necessarily on a straight slope as the relationship between two path points may suggest.

Enjoy your day.
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 10th Nov 2009 16:27
Quote: "Just my opinion but it might be more flexible just to base it on world coordinates"


I am using world coordinates (I think). What I mean is for the terrain model, it is placed at 0,0,0. Then I'm recording the positions of the waypoints ie(-500,25,250) or (750,33,-200),etc

Quote: "Using the y value in a waypoint may be superfluous or even a hinderance depending on how the character moves from 1 point to the next"


I agree. When you save a waypoint file it will create two files
1. A .txt file with # of paths, path #, # of waypoints in this path and XZ coord of each waypoint
2. A .dat file with all the data required to rebuild and display paths when loaded into the editor (XYZ coord, object #s, angles, etc)
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 10th Nov 2009 17:08
Quote: "I agree. When you save a waypoint file it will create two files
1. A .txt file with # of paths, path #, # of waypoints in this path and XZ coord of each waypoint
2. A .dat file with all the data required to rebuild and display paths when loaded into the editor (XYZ coord, object #s, angles, etc)"


Sorry for just jumping in, but why use 2 files? the first(from what i just read) is just the file header to the first, and if you are going to read them in at the same time it's easier to load 1 file and read out of it then to load 2.

New Site! Check it out \/
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 10th Nov 2009 18:01
The txt file will be used in the game. It will just contain the data required to move the enemies from one waypoint to the next.

The dat file is used by the waypoint editor, it will contain other information (object rotations, object #, Y coord, etc.) which is used to recreate the objects which represent the paths. This will be required if you need to go back and make changes to an existing saved path.

I could put it all in one file but then thats a lot of unnecessary data for the game to have to pick through. It may make more sense once I can show the program.
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 10th Nov 2009 19:13
Oh ok sorry for the misunderstanding.

New Site! Check it out \/
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 11th Nov 2009 03:47
@Latch - I've got a few pics of my lawn (gravel, dirt, grass, etc.) to use for the terrain and I have a few resynthesized to be seamless. I haven't got a gravel one yet, though, so that's what I'm working on. After I get those, I'll make the terrain. I'm using 3D World Studio, so I don't know how large the terrain will be when it is exported into DB, but I'll make it proportional so it can be scaled. Also, thanks for the 256x256, I've been trying 1024x1024 and that may be a little much.

As for texturing the other models, I don't have any sources that I know of to get textures from. Life has thrown me wave after wave for the past two weeks, it's been a struggle to do everything.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Nov 2009 05:52
I guess the idea is the best textures at the smallest size possible. It all depends. If a 256x256 of a particular texture looks like garbage compared to a 1024x1024 then maybe going with a 1024x1024 makes sense. It just has to be weighed against performance as well. If a 64 x 64 sized texture looks good, then it makes sense to use that.

Quote: "Life has thrown me wave after wave for the past two weeks, it's been a struggle to do everything. "

DB is just fun stuff, so I completely understand about real obligations.

Enjoy your day.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Nov 2009 16:14
Quote: "Any ideas for a menu system?"

I'm going to hire a few games and see if I can pick up any neat ideas.

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Nov 2009 18:32
I found my recording gizmo. Here is the title music so far...

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright

Attachments

Login to view attachments
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Nov 2009 22:11
New version with backing.
Does this sound fitting with the game?

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright

Attachments

Login to view attachments
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 13th Nov 2009 02:23
Sounds good! I think I like the version w/o the backing a little better. Just the piano alone sounds spookier. This might be good music to play during the menu/intro screens.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Nov 2009 18:36
@Obese87
Interesting. Sounds a bit sad like lost love.

Enjoy your day.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 13th Nov 2009 20:07
Yeah it sounds painful doesn't it, also a bit mysterious.
I'll have to re-record it because I got the timing out slightly. Maybe I'll try sticking some brass in there but I like the piano and violin on their own so we'll see.

Keeping the solo piano version is a good idea, having two versions will work well in the menus.

My intention is for this to play in the title screen and we have the farm scene at night in the background (before the alien attack)

"With games, we create these elaborate worlds in our minds, and the computer is there to do the bookkeeping." - Will Wright
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 15th Nov 2009 16:30 Edited at: 16th Nov 2009 00:09
@Latch - I've gotten the textures finally (a couple ended up best at 1024x1024). They aren't great, but they aren't too bad either. The main thing is that they are seamless, and only a couple have artifacts. I've attached them incase anyone wants to play with them. Since the pictures are of my yard, they are completely royalty and copyright free (to get even a hint of legal stuff out of the way =P). I'll get to work on making then terrain and texturing it now.

EDIT: Whoops, I accidentally attached the original pictures. I'm working on enhancing the re-synthesized grass ones to make them more green, hard to find a good sample patch around here at this time of the year. I'll try to attached to enhanced ones in a few hours.

EDIT2: Okay, I've got them recolored, I'm uploading them to MediaFire, now since the file is about 58 mb...sorry about that. Anyways, I'll have a link up in about 30 minutes, I'm gonna work on the terrain now.

EDIT3: Okay, here's the link: http://www.mediafire.com/?sharekey=bb50fa38a5709abbab1eab3e9fa335ca25804bb99499b8f9
I tried to sort the textures as well as I could, if the organizing is too weird then I can explain it.

EDIT4: Okay, I'm sad...3DWS doesn't like to create a terrain with more than 4 textures (I had 1 for a base, and 3 more randomly painted in and interspersed to make it not seem like it was tiled). It ends up crashing, and I'm getting fed up with it, it's been ornery with terrains for a couple of months now...I'm looking into T.ed
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Nov 2009 03:37
@Digger412
58 megs? Can you post a screen-shot or two of the terrain?

@All
The collision editor is coming along. The creation part seems to be working - I haven't tested the actual collision but as an editor, it seems to be doing what I expect. It should just be a matter of having the editor create a function that can be used by a game as source code to create collision areas. The things that need to be done are
* input area dimensions directly by typing values
* edit a previously created area
* export to a function
* hide/show specific areas

Here's a screenshot showing the functions available and the editor split view. The red areas are committed collision areas. The blue box is the currently selected and editable collision area.

Enjoy your day.

Attachments

Login to view attachments
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 16th Nov 2009 03:57
@Latch - I haven't got the terrain yet, those are just a lot of pics, 107 or so. About 70 are non-seamless, original pictures. About 15-20 are seamless renditions of those original pictures. The rest are enhanced versions of those seamless renditions. If you want, you could use those textures however you want. As for the terrain, I've been attempting to create it. I don't really like the T.ED trial, I think that I'll try to use 3DWorldStudio again. My problem with it is that it crashes often...so, I'll try to be careful..
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 16th Nov 2009 04:04
@Latch
That looks like a very usefull tool. What will the collision areas be in the game? Does it create objects (plains, boxes, etc) and create a collision box around them?

@All
The waypoint editor is complete. I just have to get some software to zip the files so I can post it here. I should have it up in the next couple of days.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Nov 2009 04:20 Edited at: 16th Nov 2009 04:24
@No Time
My intention is for it to store the dimensions of collision box areas that could be used as object collision boxes on actual objects, or static collision areas. For the game we are making, It will be used to create static collision box areas - though it lends itself to create 'hot spot' areas for any kind of trigger. It does create objects so I can get a visual of the contained areas as I edit but I have it set to delete the objects as soon as the function loses focus or returns control to the game or app the areas are being defined for.

What's kind of wild is, it wouldn't take much to turn it into a full editor that could manipulate, load, save, any object.

@Digger412
107? Wow, that's quite a collection. Just throwing this out there - Deled 3d is pretty easy to use.

Enjoy your day.
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 16th Nov 2009 04:37
@Latch
Quote: "It will be used to create static collision box areas "

I never used static collision boxes beacause I've haven't heard good things about them in the forum. Heard they were kinda buggy. Have you had good experiences with them?
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th Nov 2009 10:23
@Latch

Beautiful! Very nice job! Did we agree to use sparky's in the end or not?

TheComet


Make the paths of your enemies easier with WaypointPro!
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 16th Nov 2009 13:45
@Comet - I think that the verdict was that it would be used only if absolutely necessary, that the game should try to be written as much as it could be wholly in DBC.

@Latch - Thanks, I'll try that. I like T.ed better than 3DWS, but the mouse movement is too slow for me, accessing drop-down menus such as file, edit, etc. is very odd, and the texturing seems kinda clunky too.
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 18th Nov 2009 05:04
@All
I've attached a zip file with my waypoint editor. Here are some of the features:

Create up to 5 paths of 50 waypoints each
Move any waypoint. Delete last waypoint in a path
Works with matrix or terrain. Currently setup to work with Latch's terrain and house model.
Save and load paths
Saved paths consist of two files. The .txt file will be used in the game. Contains # of paths, # of waypoins/path, XZ coord of each waypoint, etc. The .dat file is used by the editor and contain additional information required to reload saved paths.

Let me know what you think.

Attachments

Login to view attachments
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Nov 2009 21:52
@No Time
All right! I'll have to take a look at that.

@All
I've been working on a few collision methods using DBC's built in collision and also just trying general math stuff. The static collision editor I was working on is basically complete. I setup a bunch of collision areas on a castle object because it was somewhat intricate and I wanted to see how difficult it would be to set up using static collision boxes and the editor. It definately takes time to set up...

Quote: "I never used static collision boxes beacause I've haven't heard good things about them in the forum. Heard they were kinda buggy. Have you had good experiences with them?"


Anyway, the reasoning behind my static collision box approach was for a couple of reaons:
1. Static collision boxes are realtively fast. I kept adding static collision boxes to an environment and the fps didn't start to become affected until I added around 10,000+ and even then the skew was minimal. With the static collsion boxes themselves, I haven't run into any trouble - static objects on the other hand never seem to work for me.

2. You don't need to create static objects to use static collision boxes. In fact you don't need objects of any kind at all. Static collision boxes are rectangular areas that can be queried using DBC static collision commands. So they can be set up as triggers or hot spots to be walked on if you so desired without requiring the overhead of additional objects.

3. It's possible to get x,y and z points of collision from the enironment.

Now, here's basically what I''m trying to accomplish:

DBC's regular object collision tends to be on the slow side if you use Set object collision to boxes, spheres or polygons. It can be pretty fast if you use make object collision box, but in any case, object collision return values are based on the order the objects were created. What I mean is, if I had a long solid object that extended out from the camera into 3d space and it passed through 2 objects, object 100 first and object 5 behind it, the collision result would be which ever of those objects I had created last.

I could of course, test each object individually and then measure the distance from where my long object starts to see which one is closer. But I ran into a snag when I thought about being inside of a house. The pivot point of the house could be far away and if there was collision with a creature on the other side of the wall - which should really be collision with the house, not the creature, but because the house pivot is further away than the creature, the creature collision would be considered closer - and would be false in terms of what was hit first by the long object.

The long object would be a means of shooting. Instead of moving a small bullet a certain distance each iteration, a single long object for instant collision detection seemed reasonable - except for the above scenario. So I turned to static collision boxes to map the environment.

I can use static line of sight to return the position of collision with any static collision area I might have set up in the house. I can use regular collision for a creature. If the creature is closer, then it's hit.

I've tested line of sight, and it seems fairly quick. It eats 5 to 10 fps with an accuracy of 1. I haven't tested it with multiple entities.

This method should allow shooting and hitting either the creatures or the house (or other things) and being able to place damage, or particles at the collision point with the house. I'm not sure how to return the 3d point of impact on a creature (maybe it's not necessary) for any special effects or physics (making the creature spin or fall in a certain direction, or blood sprays). I have the inklings of a couple of ideas for this.

This method should also allow sliding collision with the walls - if that's desired.

Anyway, does anyone have any ideas for getting the impact point in 3d of the creature (without sparky's dll)? And is there something else I'm missing in my collision approach?

Enjoy your day.
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 19th Nov 2009 01:28
@Latch - I looked at Deled 3D, but it doesn't look like its used for terrain creation. I've been trying it in 3DWS, but haven't had much luck...darned crashes! It's getting very annoying!
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 19th Nov 2009 19:12
@Latch - I wish I had knew about those static collision boxes for my last game, it probably would have saved me a bunch of FPS.

Quote: "And is there something else I'm missing in my collision approach?"

Sounds like a great idea!

Quote: "Anyway, does anyone have any ideas for getting the impact point in 3d of the creature (without sparky's dll)?"

The only thing I could think off would be that if you detect a collision on a creature, create a static collision box at the creatures position and then check for collision with that box. It would probably add a lot to the processing time and, since the creature is not box shaped, would not give very accurate results. I guess you could figure out what quadrant of the collision box the collision occurred in and apply damage to that quadrant of the creature. It would also be a problem if the creature is at some odd angle in relation to the player/gunshot. Now that I think of it, this is probably not a good idea, but it's all I got.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Nov 2009 00:21
@Digger412
Oh yeah, that's right. A terrain can be done in Deled3d, but if you do it by hand, you have to push and pull the verts on a grid. I had actually written a random terrain generator for Deled3d in DarkBASIC. The file format has probably changed and I'm not sure where the code is. From what I remember, it was really just about laying out the veritces how deled wants them and making the faces. Deled Automatically generates the UVs so that didn't even have to be worried about. I bet it wouldn't be too hard to make a terrain from a height map. I don't know how ambitious you are in trying to code your own terrain maker for deled! So it might just be out of the question. I would suggest Blender, but people always complain that it's too hard - though there is a neat function to use a texture (heightmap if you like) to displace vertices and make a terrain. It also allows texture blending. The hard is getting an output version that looks as good as it does in blender. Blender is designed to work in blender itself or to render pictures and movies. Once you start outputting to other formats, a lot gets lost in the translation if you're not careful.

Another route you could try, is using Terragen and Anim8or. From Terragen, output a heightmap to Light Wave format (.lwo) . In Anim8or, import the .lwo file. While this will result in a beutiful landscape model, the polygon count will be ridiculously high. You'd have to find ways of reducing that or breaking the terrain into many little pieces.

I use different methods and combinations of things I've mentioned above depending on the situation. What I used to create the terrain I used in this project was a function I wrote in DBC that loads a heightmap and outputs an Anim8or compatible file. I load the file into Anim8or and let Anim8or create the normals. I created the texture programatically in DBC and load that texture into Anim8or to texture the terrain. I save the terrain as 3ds from anim8or and I'm good to go. What I have to work out is how to get good looking terrains up close and far away. Right now, the far away looks good, but the up close looks too pixelated.

@No Time
Hmmm... one problem might be the static world IS the entire static world. Once a static object or collision box is created, the only way to get rid of it is to get rid of the entire static world.

But you have given me an idea. I'll write it as I'm thinking it, sort of sounding it out as I go.

1. Detect collision with the creature using a long box extending from the gun using create object collision box on each (the gun tester and the creature)
2. Find the distance between the creature and the gun. This would have to be done anyway if there were multiple collisions to be sure the closest creature is the one being dealt with. Could path finding come into play here? Not sure how, but as I'm typing could path finding be the entire player-creature collision method? Anyway I got off track.
3. Using the distance between the gun and the creature, find the x angle of the gun in relation to the creature's center. Assuming the creature is at a certain y position in the world and it has a certain y size, using the distance and x the angle, find out the y value of the hit.
4. Do number 3 again but this time using the y angle to find the x and z location of the hit. Off hand it doesn't sound much different that right triangle math.

Anyone want to take a stab at the math for this. I probably could work it out but I'm still messing around trying to get my static collision method stable and to prove that it is usable.

Enjoy your day.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Nov 2009 09:41
Here's the updated version of my timer-based system:

http://forum.thegamecreators.com/?m=forum_view&t=160974&b=6

TheComet


Make the paths of your enemies easier with WaypointPro!
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 21st Nov 2009 04:00 Edited at: 21st Nov 2009 05:00
@Comet - Thanks, I'll look at that soon.

@All - I finally got fed up with Vista. I've completely uninstalled DBPro and all of my plug-ins (after making 2 backups in different places). I'm gonna reinstall it into a different area, so I don't have to worry about the numerous 'Security Warnings', 'Could not create .exe', and 'Failed to build PCK file', and many more. I've nearly completed it, just have DarkPhysics to go, then all of the user plug-ins..shouldn't be long and I'll be up again, hopefully much better than ever =D

UPDATE: I've gotten everything reinstalled, looks like it'll give me MUCH less trouble now =D =D

Random Edit: I've been playing with RiiDii's iConstants, and they are some pretty cool little buggers! I've messed with his formula and added more constants (it went from a*b+c to (a#*b#+c#/d#)^e#), and it still has been able to 'learn' what the variables should be in about 30 seconds. It's DBPro only, but they are a lot of fun: http://forum.thegamecreators.com/?m=forum_view&t=145416&b=8
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 21st Nov 2009 05:10
Ummm i think that was the wrong thread digger... lol

New Site! Check it out \/
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 21st Nov 2009 05:30
Na, I meant to post here. I didn't know if I could be down for a while because of the reinstall, but I wasn't then I was playing around with the i_Constants, to check and see if everything worked..
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 21st Nov 2009 06:07
Oh ok just checking(i saw abunch of dbp stuff thats why i questioned)

New Site! Check it out \/
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 21st Nov 2009 21:48
@Latch
Quote: "Anyone want to take a stab at the math for this. "

I'll been awhile since I studied right triangle math but I've been reading up in it so I'll give it a shot.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 24th Nov 2009 23:38 Edited at: 25th Nov 2009 05:46
Quote: "I'll been awhile since I studied right triangle math but I've been reading up in it so I'll give it a shot. "

You may not need to, but don't hold me to that yet. In testing out the static collision box creator, I ended up also writing my own static line of sight function. It's much faster than DBC's LOS as long as you set the parameters properly. It also seems to be farily accurate. The more accuracy the slower it performs - actually on par with the built in LOS. It could be adjusted to return the result of a collision with an object within the line of sight - returning the closest objects first. But I don't know what the speed would be compared to the triangle math method.

@all
Anyway, here is a demo of the static box editor and the resulting static box environment in action on a complex interior of an object. When you start the program, you can select the resolution you wish to run it in.

After the resolution screen, you'll see the credits. Press ENTER to continue. You will see a 4 way split screen. This is the editor ready to do your bidding on the included castle model. Which ever window the mouse is in, is the active window. Control is a bit tricky, as I wrote the app for my own uses.

The commands in the editor are included in a text file labeled 'Instructions.txt'. To Bring up the Menu commands, press the 'M' key.

To get from the editor to the castle environment and walk around and test out the sliding collision, press 'M' to bring up the menu, then press 'Q' to quite the editor to return control to the main program.

I am hoping that some people could test out the performance of the castle environment with the sliding collision and so forth. To test the line of sight, left click the mouse. A white sphere will appear at the point of contact on the wall where the line of sight is directed (where the camera is facing). The distance is for 1000 units. The castle is 6000 units long I think.

Move around the castle with the arrow keys and steer with the mouse. The default Sync rate is set to 0 . Try switching it to something more stable (like 60 or 40) by pressing the 'SPACE' key while walking around.

let me know the FPS you get when generally walking around and also when you use the line of sight. Also let me know if you fall through any walls, or get stuck somewhere that won't let you move at all.

To switch back to the Editor mode press the 'M' key.

There is a file included : 'Staticbox.arr' . This contains the layout for the static environment that one would setup in the editor. I recommned making a backup of this before messing around with the editor as it's possible to change the static collision environment of the castle. Beyond that, feel free to mess around with whatever functions in the ediotr you want.

If you want to take a look at the static collision environment (it ain't pretty the way I set up the boxes), when in the Editor, press M then L to load in the static environment saved in Staticbox.arr . The red boxes are the committed static areas. The cyan box is the currently active and editible one. The menu has various selections including editing any existing boxes so feel free to play.

Managing the editor takes some getting used to. To do things like ramps and stairs, I added a copy command to the menu. This command allows you to create a number of copies at a certain slope of the currently selected object. If you type in the correct offsets, you can set up stairs or a ramp for static collision with a single command.

Here's the attachment:

Enjoy your day.

Attachments

Login to view attachments
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 25th Nov 2009 05:42
Wow! great job latch!

New Site! Check it out \/
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Nov 2009 05:48
Thanks Caleb. Give it a test and try different resolutions and different sync rates. I'm interested in getting an idea of the performance - especially when you use the line of sight (left click in walk around mode). I'm also curious to know if you are falling through any areas.

Enjoy your day.
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 25th Nov 2009 16:13
I set the sync rate to 0 on my machine(latitude d510 not to new lol) and i had about 90-99 fps without line of site and about 85-90 with it.

I walked around for about 10 or 15 minutes and i never fell through anything. the collision looks great! i will try it on different display modes though. that was 640x480x16

New Site! Check it out \/
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Nov 2009 23:20
Quote: "I set the sync rate to 0 on my machine(latitude d510 not to new lol) and i had about 90-99 fps without line of site and about 85-90 with it. "

That seems fairly consistant. I get about 107 fps when using a screen res of 800,600,16 - and about 60 to 70 fps at a screen res of 1024,768,16 .

The camera rotation is a bit jittery when I have the sync rate @ 0 so setting it to 60 makes it run much smoother.

@No Time to Code
I checked out your waypoint editor. Very nice. Good work! It runs a little labored though. To help improve performance, in the _move_mouse_terrain subroutine, change the feeler test for terrain height to a larger increment. Try 1 instead of .1 . It makes a big difference.

Also, the use of spheres as waypoint markers will quickly destory performance - especially with collision set to on and to spheres.

A few questions:
1. Why only 5 paths?
2. How will the waypoint data be used in game?
3. In terms of the editor, why manage and record the rotations of the waypoints?

Thanks for working on this. A far as the outside waypoints, I had envisioned there being maybe 100 or more predefined paths (created ahead of time with a waypoint editor). As creatures would enter the scene, they would randomly pick a path to follow and follow that path until they gain entry to the house, or get killed trying.

As performance allows, I was thinking there would be a max of maybe 20 creatures at any one time running around. Depending on the level, as a creature gets killed, another is spawned and chooses a random path and makes it's way to the house.

Does this seem reasonable?

Shooting:
In regards to shooting, I don't think it will be necessary to use the triangle math to calculate the impact point on a creature, though I still haven't tested it's speed versus the method I've come up with.

By using a long limb attached to the front of a gun, hiding it and testing for collision against a creature, we can find out where the creature is hit by projecting an object from the barrel (ideally) or from the camera to the distance between the camera/gun and the hit creature. The final position of this projected object will have coordinates of the hit point.

The fastest collision in DBC it seems (besides static collision boxes) is to use MAKE OBJECT COLLISION BOX around the objects to be tested. In this case, the no rotation flag is set to 1 to allow rotating collision boxes, especially useful for the gun and it's long feeler that will be pointing all over the place. Though boxes aren't super accurate for strange shaped organics - but performance over accuracy may apply in this case.

Here's the code with the rotating collision boxes. Move around with the arrow keys and steer with the mouse. Left Click to test shooting. A red box will appear at the point of impact. The creature is a cone so you can see some of the inaccuracy of the box collision. I tried this with polygon collision and it is very accurate but about 20 fps slower when shooting. That'd add up with multiple creatures running around.



Enjoy your day.
Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 26th Nov 2009 00:33 Edited at: 26th Nov 2009 00:39
@Latch - If you're still looking for a way to find where the monster was shot, could you create multiple collision boxes for one monster? You could have three boxes for each arm (hand, lower arm, upper arm), three for each leg (foot, lower leg, upper leg), one for the head, and two for the torso (upper and lower). I don't know how fast it would be, or if it would even be feasible...

EDIT: Tried out you're code, found out that box collision probably wouldn't be the best way..

http://yfrog.com/07accuracyp
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Nov 2009 02:32
@Digger412
That's not a bad idea actually. If there was a hit on the creature, I could then I could test for collision against 6 hidden plains or boxes that I can share with all of the creatures: head, left arm, right arm, left leg, right leg, torso. The positions could be uniform or I could position them according to the positions of the limbs. I should try it out. I wonder how much more overhead it might create...

Did you also try out the sliding collision demo I posted up a few messages? I would just like some feedback on the performance.

@all
I went ahead and tried using sparky's for collision testing and shooting. The interior sliding collision is a bit faster - maybe 10 to 20 fps in 800,600,16 but it's about the same at 1024,768,16 on my machine.

One problem with sparky's since it's just a ray being cast against the polygons of an interior, if there are any gaps in the polygons, the ray passes through - that means walking through walls and floors unexpectedly unless the model is absolutely water-tight.

With a static collision box, an entire surface is generally covered. Even gaps. Just thought I'd throw that out there. Anyway, the goal is still to make this 100% DBC (except for media) and so far the collision doesn't seem to be a problem. Still have to add multiple entities running around and random objects in the environment.

Enjoy your day.
No Time To Code
15
Years of Service
User Offline
Joined: 22nd Dec 2008
Location:
Posted: 26th Nov 2009 03:10
Thanks Latch.
Quote: "Also, the use of spheres as waypoint markers will quickly destroy performance - especially with collision set to on and to spheres."

What would you suggest using instead? I can't use plains because the spheres actually rotate to align the path objects.

Quote: "1. Why only 5 paths?"

No reason, just picked a number. It shouldn't be a problem to increase although I wasn't thinking about using 100 paths. The only problem I see is what you mentioned about the performance hit from all those objects.

Quote: "2. How will the waypoint data be used in game?"

The .txt file that is created can be read into the game as an array. It would contain the # of paths, path #, # of waypoints in each path and XZ coord of each waypoint. Once the creature picks a path it would just move from point to point.

Quote: "3. In terms of the editor, why manage and record the rotations of the waypoints?"

In addition to the txt file used by the game, the editor creates a .dat file with the data required to recreate all the saved waypoints and path objects. The rotations are required so the waypoints and path segment object will line up properly. This data is not needed for the actual game.

Quote: "Does this seem reasonable?"

Sounds good. We will just have to consider that if the player leaves the house, the outside creatures will have to switch to pathfinding (A* or something simpler) to track and approach the player.

Quote: "In regards to shooting, I don't think it will be necessary to use the triangle math to calculate the impact point on a creature, though I still haven't tested it's speed versus the method I've come up with."

Seems like it works well. I have been trying to use triangle math as you suggested but I'm not quite there yet. Below is the code I've got so far. Basically it calculates a position X distance from the gun (bulletdist) and places a sphere at that location. It then places a long object box connecting the gun to the sphere. I used SET OBJECT COLLISION TO BOXES because I couldn't get the collision box to work (I didn't know about the rotation flag you mentioned in your last post, that may be what I was missing). Anyway, if collision is detected it uses a combination of right triangle math and the NEWXVALUE command to place the shot on the creature (a cube object in this program). It seems somewhat accurate within this well defined environment. I don't think it will work (in its current state) if the target was moved behind or to the side of the gun. I'll be glad to go with your version. One thing I was thinking about, how will either one of our methods work if the creature is at some odd angle to the gun? So, if the creature is directly facing the gun it shouldn't be too hard to relate the XYZ coord of the hit to a part of the creatures body. Might also work well if the creatures back is to the gun. But how do you place the damage if the creature is at a 48 degree angle to the gun? How do you know what body part is has hit?

I've only got to check out your static collision editor for a few minutes. Looks great! It must have taken forever to set up boxes for the whole castle. I'll get back to you with my FPS but keep in mind, my PC is old (Pentium 4). I'm getting a new one in a couple of weeks (the new Intel i7-920 chip so I can join the 21 century)
I did not fall through any areas.

Digger412
16
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 26th Nov 2009 04:18 Edited at: 26th Nov 2009 04:23
@Latch - Here are some results for you, hope they help:



@NTTC - i7...I envy you. We have an OLD Pentium 4 too..maybe it'll get shipped to me..*tweaks postal package routing system*

Login to post a reply

Server time is: 2024-04-18 22:57:25
Your offset time is: 2024-04-18 22:57:25