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 / Lee Bamber needs a DBPro hero!

Author
Message
RickV
TGC Development Director
23
Years of Service
User Offline
Joined: 27th Apr 2000
Location: United Kingdom
Posted: 18th Sep 2013 18:33 Edited at: 18th Sep 2013 18:33
Hi,

Check out Lee's latest blog. Can you help the Father of DBPro?

Lee's Reloaded Blog


Rick

Financial Director
TGC Team
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Sep 2013 22:28
Interesting problem. I wont promise anything but I'll certainly give it a think.


Formerly OBese87.
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 18th Sep 2013 22:35 Edited at: 18th Sep 2013 22:36
Quote: "I am looking for someone with some experience of DarkAI to write a new very small prototype which will take 1024x1024 height data and create a series of DarkAI polygon obstacles that contour around the raised parts of the terrain. y current technique is to detect a height difference of 50 units, and if detected, slap a box there. Crude, and is a performance hog. I need a system that can do this in real-time (as the terrain height data is being modified). Does not have to be 60 fps, just something that can be fired off and the DarkAI obstacle map adjusted in less than a second, ready for real-time game play.

It's something I am getting around to, but it's a B priority while I cobble everything else together so having someone produce the goods in parallel to what I am doing would be very helpful. Just email at lee@thegamecreators.com or comment here for more information!"


Sounds interesting. I could not be that hero at the moment because of lack of time. But I can support with some ideas in this post; I've got some terrain and Dark AI experience.

Like Obese v2, I'll give it a think.

Sid Sinister
18
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 19th Sep 2013 00:44 Edited at: 19th Sep 2013 00:45
It's been a long time since I've used TGC products. I saw the challenge on Facebook and decided to poke my head in

There's no escaping the fact you're going to need to check for any modifications in terrain every frame. You could skip the heavy lifting until a condition is met, then proceed to generate new collision but... depending on how much there is to recalculate, you're going to notice a lag spike, especially if that collision lasts over hundreds of frames (ie, the object is still passing through the terrain, removing parts of it as it goes, thus needing to recalculate for every subsequent frame). With this in mind, I might look for a way to forgo editing the collision model until the collision has stopped.

It's always better if you can cull calculations to the portions you need. I have no idea how your engine is setup or how DarkAI really works, but my protip would be to look into how you can achieve that. Perhaps collision objects aren't the way to go. My first thought was to switch to an A* grid and use an octree-like system to only focus on the part of the grid you're currently on or that whatever projectile you just fired in the distance is going to hit. Collision objects help you get something up and running fast but if you rely on them for your entire collision system your going to pay for it. I'll bet you a more complex solution is in order.

In summary, the smaller you can make the area it checks and recalculates the faster it's going to be.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 21st Sep 2013 19:31
Do you need an obstacle? Can you not simply make the path cost much higher? Then it can still be overcome if necessary.

This is how I worked with my railtrack-based game to stop the computer AI carriage double-backing on itself, and to add seemingly random bad decisions by the AI.

It involves copying the AI map to a memblock, but it worked fast enough for me.

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 22nd Sep 2013 14:12 Edited at: 22nd Sep 2013 19:36
Is Matrix1 being implemented in the FPSCR source code?

[edit] Nevermind, Lee answered my question related to using Matrix1 in the solution; which you may

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Sep 2013 03:01
Why would detecting for a height difference be such a performance hog?

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Sep 2013 09:41
Quote: "Why would detecting for a height difference be such a performance hog?"


This is for the computer-controlled character AI. It's already using DarkAI and this doesn't account for height. It can account for height indirectly by changing the path cost. I used this technique here to get the character to walk around a hill rather than straight over it.

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 4th Oct 2013 22:14 Edited at: 4th Oct 2013 22:57
Well I have spent some fun time enjoying some work on this heightmap AI concept.

I took what Sid Sinister suggested and started to put something together. The first phase was to work on heightmap sampling.

Each pixel on the heightmap represents the height of the terrain; the brighter the tone, the higher the peak.



So far I have a function library set up which creates obstacles around the peaks of the height-map. The system is creating AI obstacles when ever an area in the terrain source is much higher than the floor. The accuracy is controlled by the octree depth. The obstacle images posted are generated by the DBP functions.



At this point I am not concerned with overlapping obstacles, because I have added a parameter which allows you to permit a specific amount of overlapping obstacles for various needs; such as determining the shape of high peaks for aircraft flight or terrain movement cost something; my elements can hold obstacle information without creating additional AI obstacles if required.

The depth of the octree can be changed, here is the terrain sampled with a high octree setting.



By adding the overlap parameter, it is possible for certain terrains to only produce no overlaps



Now time for more detail. The heightmap can be altered and the obstacles updated in realtime; however there is a lot of optimization work that is required for a smoother finish.

Each terrain can be given a variable number of layers. Layers control a certain number of obstacles at a certain altitude. Hopefully I will find a way for Dark AI to assign paths to layers; but for now, the AI will not walk into a different layer, unless forced by the system. Each terrain obstacle belongs to one layer; and each layer can contain more than one AI container (area) with their own obstacles.

Here is an image of the first refinement of layers.



Here is an image of the second refinement of layers; contain 3 in total. AI placed into a given layer should avoid entering other layers indicated with different hues, the dark areas represent the low points, and the lighter areas are up in what is to become the mountains.



Here are the layers all separated.







My next step on my next available opportunity is to add the terrain and the AI, alter the terrain and height-map during the simulation, optimize the obstacle processing and test and tweak the simulation as a whole.

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 9th Oct 2013 05:23 Edited at: 9th Oct 2013 05:32
Now that I have some obstacles to work with; time to start getting the AI and terrain elements into the concept. I have put aside any additional optimization for later, when the major bottlenecks become more obvious.

At the moment it looks like a decent game can be put together with the Dark AI plugin judging by how the obstacles look; but I wanted to add a feature to assign the AI to certain layers on the terrain. To do so I have added an option to generate AI containers to each layer; or if required a specified list of containers are given their own copy of the obstacles in each layer.

To stop the AI from moving from one layer to another I made an optional parameter which forces the generator to create obstacles surrounding the given area, so that the following unsealed layer



ends up looking like this.



Now any AI assigned to the hills, represented here by the grey bits, stay on the hills. There are an excessive amount of obstacles here, but I got an idea of what I will do to simplify the result; something I will look into another day.

Now I will start working in 3D. I will use the tradition of using cones as Dark AI entities. I assigned green AI to the green layer, blue AI to the blue and red AI to the red layers. The player is the yellow sphere.

So far as shown below, the generator has a margin parameter which causes the Dark AI obstacles to overlap a bit to make sure no issues of getting stuck can happen.



I am considering adding some filtering later on to make beveled corners so that the AI walk around areas in a bend rather than making constant 90 degree turns around corners. Or perhaps if Lee decides to use this concept, he will have a better idea.

To illustrate what is happening for my own understanding, I have added a plane rotated about the X axis by 270 degrees; and I have textured it with the heightmap.



Next I added the second layer which is situated in the hills. I used the AI Debug Show Obstacle Bounds command to reveal the edges of the obstacles; which is one of the many Dark AI debugging features.



Here is the latest obstacle chart illustrating what I will be working with for the time being.



The colours are faded together a bit much but the image illustrates how the AI entities will stick to areas that do not feature their colour; for example, the red guys will stick to the green-blue spots, and the blue guys will stick to the red-green spots; again the hues are not very saturated, but when the terrain is generated the illustration should look a lot more clearer.

The reason why the AI will stick to the areas illustrating their opposite colour is because the obstacles of their own colour are blocking their movement; each obstacle is illustrated with semi-transparent boxes mixing blended with the other boxes, hence the colour alteration.

Now below is an illustration containing the red obstacles, and the red guys surrounded by them. The white bits underneath the AI cones represent the mountains for what is to become the terrain.



The blue guys are not concerned about red obstacles, they belong to a different AI container; AI containers separate AI elements. However, the blue guys will never climb up hill into the white spots; the following image indicates why.




All of the white bits in the above image contain blue obstacles. If we wanted the blue guys to climb up the mountains we would need to transfer them into the container assigned to the top layer.

Now; I forgot something when working on the terrain. By default the Blitz Terrain plugin will not mirror the heightmap image when sampling. This is an issue because high coordinates in 2D imaging are at the bottom of the image, but in 3D the low coordinates are at the bottom.

Using the following heightmap, I expected to see hills in the north-east end of the object, but they ended up in the south-east.





To fix this problem, the following line forces the Blitz Terrain system to mirror the heightmaps it samples.

BT SetAtMode 1

Hopefully if Lee uses this concept, he is also mirror imaging his Blitz Terrain heightmaps otherwise something will need to change here.



Now that the hills are in the right place, the green guys are at the bottom, the blue guys are in the middle and the red guys are high up in the hills, I can add the terrain. I will integrate the terrain builder with my AI terrain class for convenience.

So, as hoped for; the green guys follow me along the gullys and valleys.





The blue guys are sticking at mid altitude.



The red guys are on the mountains but do not concern themselves with my yellow player because we are in different containers. Neither do the green guys concern themselves with me.



What is left to perform now are real time terrain changes; something I will need to do with the free version of Blitz Terrain some how... I will also create special ramp like elements which allow the AI to walk up or down layers. I will also add an array of user defined obstacles for each layer to work with the buildings set by the FPSCR editor in conjunction with what is discussed here in the blog.

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 11th Oct 2013 19:47 Edited at: 11th Oct 2013 19:48
I had a half day slot for this concept today and got as far as optimizing horizontal tiles and creating a terrain refresh function which produces obstacles in a designated area.

There will be a horizontal strip, vertical strip and square optimization iterator added to the whole optimization function by minimum; all of this should be ready quite soon.



So far the horizontal strip optimization has been tested and has increased the FPS by 100% with the same number of AI players; 90. The FPS is still likely to be hurt the more dense and detailed the obstacle sampling; so in combination with the vertical and square algorithms, we should have enough resources to deal with real time updates.



Here is an image of what I mean by horizontal strips; notice how not all obstacles are square anymore. The depth of sampling is pretty low in this illustration, but it is good illustration of what is happening in the optimizer. The vertical strips will perform in similar fashion, the only difference is they will reduce obstacles from north to south instead of east to west. The square optimizer will reduce in both directions at once.

One of the most important functions in the concept is the ability to make changes to obstacles when something happens to the terrain. The refresh function now accepts a set of area parameters which limit obstacle sampling in a specific area as shown by the following examples.





With a little playing around I found some settings which improve the optimization, as shown by the larger strips.



Next phase will require all optimization techniques to be applied, and to make real time updates to areas of the obstacle map.

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 19th Oct 2013 09:32
Wow, this is really cool. I hope Lee appreciates what you're doing here, Chris.

Awesome work!

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 19th Oct 2013 16:39 Edited at: 19th Oct 2013 16:40
Thanks. Almost ready; well it is a bit like a small piece of a greater puzzle; which is to implement it all in the engine. Hopefully the way I coded it will be easy to understand and implement. I've read the FPSC code, but I do not know what the FPSCR code looks like.

I like this library so much I intend to use it myself for racing and trekking sports. Last thing I have to do is demonstrate it; it is practically 95% complete as far as having AI move around the terrain and having it change. The thing is I must wait until the end of the month before I can get the full version of Blitz Terrain, so I can implement its terrain modification functions, but for now I used various terrain objects to illustrate terrain modification.

If some work I've got to do goes according to plan, I might have the proposal ready tomorrow.

Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 19th Oct 2013 17:13
Have to agree with Clonkex here Chris, really great work

"Get in the Van!" - Van B
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 29th Oct 2013 12:17 Edited at: 29th Oct 2013 12:18
Well it has been a drastic two weeks at work, but finally I have been given some spare time for social life; the thing is can't have a social life at the moment with all of these projects, so time for some programming.

I just purchased the full version of Blitz Terrain after all these months. I postponed my order thinking Blitz Terrain 3 would come out, but it does not seem to be ready, and this help request is BT2 based, so I may as well buy it. I will still have Advanced Terrain implemented in library, however if used, TGC can decide to remove the implementation if they do not use AT for anything.

So far I have run into a few problems with obstacle edges; some of the AI gets stuck between edges when the layout is regenerated as shown in the following videos.





Before putting my mind on this issue, I will be working on an area system. Areas will be a means of implementing various functions in 3D space which interact with the AI obstacles in one way or another, such as permitting AI to walk up or down hills, regenerating obstacles in a certain area as it is changed, removing any obstacles in the given area, creating obstacles in the given area, generating finer or courser obstacles in certain areas; hence a manual utility for the developer.

The areas can be circular or rectangular, boundless in height or measured to fit the need. These can be attached to vectors or objects, and objects or vectors can be attached to areas.





I am really hoping the full version of Blitz Terrain outputs real time terrain modifications to the heightmap image so that I can sample the changes from there; otherwise I will need some kind of a way to calculate what obstacles ought not to remain, and what obstacles ought to be spawned as the user or game engine modifies the terrain.

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 30th Oct 2013 01:48
Quote: "Blitz Terrain 3"


What? Is this actually happening?? I haven't heard anything...

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 30th Oct 2013 05:12
It is being worked on, but the developer seems rather busy creating a new Blitz Terrain 2 build; and possibly he is helping out with FPSCR.

BT3 Has been mentioned here (more or less a year in the making so far)

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 30th Oct 2013 14:07
Quote: "It is being worked on, but the developer seems rather busy creating a new Blitz Terrain 2 build; and possibly he is helping out with FPSCR."


Cool! And yeah, I think kaedroho is having to add a few things to get it working for Reloaded.

Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 5th Nov 2013 14:03
Omg, Chris. Looks very cool!

Regards Sph!nx
www.mental-image.net
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 5th Nov 2013 22:59
Thanks for that; I am rather furious at the moment because of the amount of hours I have had to work last week; so little time for this and just one important thing to implement at this stage.

I did not know you could not move a Blitz Terrain around; you can't change the position of a Blitz Terrain can you? (I have only just started using the full version) Why would you bother with more than one terrain if they have to all be in the same position? I must be mistaken.

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 6th Nov 2013 01:16
Quote: "I did not know you could not move a Blitz Terrain around; you can't change the position of a Blitz Terrain can you?"


Huh. Surely not. Surely it must be an undocumented command... that seems really dumb that they can only be in one position. I'd never thought of that.

I'd ask kaedroho if I were you.

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 6th Nov 2013 01:25 Edited at: 6th Nov 2013 01:29
Actually, what I would try doing is positioning the DBPro object that you need to use to create the terrain. Try that.

EDIT: Ok I just tried it on one of the examples, and it works, but BT GetGroundHeight still reads from the original position, so you'd need to offset it manually

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 6th Nov 2013 23:26
Yeah, that is reasonable Clonkex; I can create a function to offset the ground height using the object position against the origin of the height data.

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 16th Nov 2013 23:18 Edited at: 16th Nov 2013 23:24
Oh dear .

Why is the remove obstacle command not working?

In the following example, the two obstacles created where removed, but they still exist in the engine. OK, that sentence was not brilliantly worded, but what should be removed, remains in existence.



I found this out the hard way when attempting to update the obstacle layers as the user moves an eraser around. I imagine the whole point here is to perform live updates to the AI waypoint map? Although the erasing of the obstacle management-data is all well and good; not being able to remove obstacles during the session means having a more constrained experience. No testing the AI whilst finessing it.

How on earth are people partitioning game level obstacles per game level without being able to remove obstacles from the previous level? Why are those stubborn things still there?

The most confusing thing is there is one instance where the obstacles where succesfully removed after the ai complete obstacles call in the actual terrain AI program; when the eraser was first created. After that, any further removals do not work.

I will put this aside for a while and concentrate on synchronizing obstacle coordinates with terrain modification.

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 21st Nov 2013 22:31 Edited at: 21st Nov 2013 22:34
Hey Chris,

It's an old post, and probably not the version of BT you are using, but it might give you some ideas.

BlitzTerrain: Endless Terrain Demo

The edges that don't match up are part of the problems that Kaedroho was working on back then. It's an LOD issue between the terrain that you are standing on, versus the one next to it.

Hope something in there might help you out. Great work BTW.

<edit>
Oh, and it might crash on you once in a while when you move from one map segment to the next. Kaedroho said it was a memory management issue most likely. As you move away from a map segment it deletes it, and creates the next map segment in the distance in the direction you are headed.
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 29th Nov 2013 17:53
Thanks KISTech; I have bookmarked your post because the program you made looks useful for this task and for my own projects.

On a side note related to my endeavors, I have been thinking about the concept of triangular terrains which could be used to replace polygons on a globe as well as other objects; although I am also experimenting with tessellation and subdivision for that purpose. If you have any ideas or tips regarding triangular terrains, please let me know.

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 29th Nov 2013 18:13 Edited at: 29th Nov 2013 18:13
It is has been a while since I got some spare time, but I finally got round to implementing terrain modification; nothing comprehensive, just an aid for demonstration. The FPSCR AI system may already have been implemented with terrain ready attributes; but at least the final product of this library may prove useful here and there.

The terrain modification operation is activated by mouse clicking and dragging along the terrain, as I believe is the case in FPSCR which I have not yet used. The terrain modification function not only adjusts the height of the terrain, but also attempts to reflect the change in the heightmap image.

In the following images, the green squares above the image of the heightmap represent the obstacles which are activiated to affect the AI. The yellow box is the area of focus used by the obstacle generate which is resized to match the paint operation.






The next step is to correct some issues with overlapping obstacles caused by excessive obstacle creation. I also need to prevent the AI from moving through the edges of the obstacles, they seem to be able to get through some of them as shown by the little green guy towards the end of this video.



The following image demonstrates the excess of obstacles, there being 11448 in total with optimization switched on. Not all 11448 are activated, but this is still far to excessive. The generator is not checking for larger obstacles when inserting smaller ones. Will need to find out why the functionality for this is not functioning.



Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 16th Dec 2013 02:18
Good work, Chris. I'm sure Lee really appreciates all the work you're putting in here

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 16th Dec 2013 19:15
Thanks good friend. It has taken four times as long as I expected it to since I can only do about 8 hours per week on the job. Lee may have already had to implement his own system by now, but there might be some gems in this library which have a home their product.

The main nuts and bolts of the terrain AI is complete.

I am at present smoothing off the edges and making final tweaks. This is by no means a one off project; rather an ongoing one with some additional features to be implemented. This may lead to it being released as a snippet if TGC permit it.

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 3rd Feb 2014 19:48
@Chris Tate

umm any chance of posting source code ?

to move side ways - is to move forward
Since a Strait line gets thin fast
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 14th Feb 2014 22:06 Edited at: 14th Feb 2014 22:08
I am planning to book some time off work to further refine the library and write its documentation. The documentation will be formed as standard DBP html files, since the IDE help-lookup (F1 key) system can work with user defined code too.

I will have the library posted as a snippet in the code snippets forum so all can make use of it and hopefully improve it. It will need plenty of refinement to implement into a commercial game, but it is a good looking template that can get you started with terrains and AI.

I am sure TGC have by now created their own terrain AI system for FPS Creator Reloaded; but they may obtain a number of interesting ideas from my library when I post it.

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Feb 2014 22:20
I just started playing with "BlitzTerrain"

i had found the editor but the only thing i do not get is how that i
am using a 2048 x 2048 land image and the one in the example uses a
1024 x 1024 and it seems to cover a much larger area

i know mine has more detail well like it might

it would have nice to have the option in "BlitzTerrain" to place
the land built with it at center location or to be able to
load 4 in total land masses and place them so i could have
even more area

i hope in version 3 that is a option

to move side ways - is to move forward
Since a Strait line gets thin fast
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th Feb 2014 13:21
Quote: "
it would have nice to have the option in "BlitzTerrain" to place
the land built with it at center location or to be able to
load 4 in total land masses and place them so i could have
even more area"

You can, with the paid version. Standard position object commands can be used to position the terrain, and you can create any number of terrains as you have the ram for.

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 15th Feb 2014 15:00
@Mobiius

i have the paid version but i guess i am not seeing the command
i should be seeing

as for the ram is 8 gb enough ? ;o)

to move side ways - is to move forward
Since a Strait line gets thin fast
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 15th Feb 2014 15:04
@Mobiius

I've got version 2.02 R1 of "BlitzTerrain"

looking though the pdf file and i'v not seen the cammands
nor is there an example to work with

to move side ways - is to move forward
Since a Strait line gets thin fast
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Feb 2014 12:01
What command are you looking for?

To position a terrain, use Position Object.
To create another terrain, just create another terrain the same way as the first terrain, just use a different terrain ID....

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 16th Feb 2014 20:48
@@Mobiius

i was hoping there would be commands to place a terrain

like

BT place "object","x","y","z"

but sadly that is not the case

i know there would have to be numbers like 1 to 4 to load a land

to move side ways - is to move forward
Since a Strait line gets thin fast
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 16th Feb 2014 23:42 Edited at: 16th Feb 2014 23:43
Quote: "You can, with the paid version"


Actually, it's not that simple. If you simply create four terrains and place them next to each other, the edges won't "attach" and you'll get gaps due to LOD differences. It won't look good.

Quote: "i had found the editor but the only thing i do not get is how that i
am using a 2048 x 2048 land image and the one in the example uses a
1024 x 1024 and it seems to cover a much larger area"


When you're setting up the terrain, there'll be a "scale" parameter there somewhere (I forget which command it's in). Increase that to make the terrain bigger. I think it's BT SETTERRAINSCALE.

Quote: "as for the ram is 8 gb enough ?"


Well... DBPro is a 32bit program and creates 32bit programs, which means they are limited to about 1.8GB of memory per program. No DBPro application can use all 8GB of memory. However 1.8GB should be heaps for creating 4 terrains (but don't quote me on that).

Quote: "i was hoping there would be commands to place a terrain"


Look, you CAN do this, and Mobiius told you how. Use POSITION OBJECT to position the DBPro object you used when creating the terrain and the terrain will move. Easy.

Hope this clears things up a bit

gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 18th Feb 2014 17:47
@Clonkex

at least 2 of the same land masses could be used side by side
just turned so that the mirror of it would line up with no
seams

I've been playing with the scale command
some thing I've not dun yet has things not quite right

i know DBPro is 32 bit

no game should be using all 8 gb of ram it's hard on
the computer life span

as for positioning
i did use that command for placing my objects

it's nice to know how much of the system resources will be available to me ;o)

the laptop i have can handle a lot being put on it compared to
the low end one most people have out there with no real cooling fan's and win 8 / 8.1 junk

to move side ways - is to move forward
Since a Strait line gets thin fast
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Feb 2014 17:38
If you want different levels of navigable terrain then you have to consider differences in heights rather than absolute height.

A simple solution would be to divide up the level into a fixed grid (say 32x32 tiles of 32x32 data points). A set of obstacles is generated for each cell completely independently of the other cells. When the terrain is modified, you remove the obstacles for the modified cell, recalculate them and add the new obstacles.

Within each cell, the obstacles are calculated by taking the gradient of the height data, and comparing that against a threshold value to get essentially a monochrome image - each pixel is either navigable or not navigable because it is too steep.

The next step is to generate polygons from the raster data: there are numerous algorithms for this, marching squares is a nice one. By down-sampling before applying it, it will generate fewer polygons and you can get smoother edges on the obstacles instead of just 45 and 90 degree edges.

This algorithm will take time proportional to the number of pixels invalidated, which is the best you can do since any single pixel change could have an effect on the obstacles which need to be generated, so each pixel must be considered at least once.

Plus, this algorithm will generate much more efficient geometry than any which can only generate boxes, which should greatly help path-finding speed.

Finally, the nature of having completely independent cells means that if a number of cells are invalidated, the program can update one at a time while still being responsive to the user in the case of a single thread of execution, or update all of them in parallel when multiple cores are available.

[b]
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Feb 2015 10:03
unstickied

Quidquid latine dictum sit, altum sonatur

Login to post a reply

Server time is: 2024-04-16 23:37:13
Your offset time is: 2024-04-16 23:37:13