dim3 Forum

Full Version: Complex A.I.?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
So I imagine it might look something like this....

Make grid of nodes, tell bot to attack node X, if no one at node X proceed to node Y and attack, and so forth and so forth?

I am still wondering how to make it so they perform multiple actions, yet have them perform said actions only when appropriate, such as, say, tell bot to attack node X, if no one there proceed to attack node Y, if encountered grenade object take defensive measures, that sort of thing?
You'd basically tell it to node-walk to node X.
When it arrives, you get an event.
Now check if there are enemies nearby (and attack them) or anything else you can think of (depending on your gameplay and map). If theres nothing there, walk to a different node and do the same thing.
You could also add a certain randomness to it. Maybe something like... a 10% chance that the bot will not attack enemies, but run away and take cover instead. The more enemies there are, the higher that chance becomes.
The APIs are all there, it's up to you what you do with them.
An excellent idea.....but if I put that randomness as you say, wouldn't there be a 10% possibility that the bot will run away and take cover REGARDLESS of if there are enemies present or not?

Wait....or do you mean it would check for the enemies first, then execute that random 10% chance only if it finds someone. That would make much more sense.....


I think I am beginning to understand.... (Still a bit durrr, but getting better!)
I recommend planing the AI first.
Take a sheet of paper and create a flow chart of what the bot is supposed to do, action after action.
If I get the chance, I will upload an example later today or tomorrow. I really have to sleep now. :P
I figure I might try to make a turn based game similar to the old school Worms games, that would simplify our current issues with scripting A.I., however I am encountering other problems....


For those who have played it, Worms uses a free roaming cursor to facilitate the use of certain weapons (i.e. Teleport, Airstrike), which is proving problematic, as I am uncertain how I might script this for myself (Dim3 doesn't seem to have such a cursor; ideally it would be manipulated with the mouse, as per the cursor on the title screen, but that doesn't seem to be possible at this time.) I was originally thinking of setting the cursor as the Player, but that will not work due to the fact that the cursor needs to be able to pass through the landscape. In other words, the cursor needs to be able to pass through the land, whereas the bots need to stay on solid ground. Therefore, how would I make it so that only the cursor passes through the landscape, but nothing else?


Another major point of contention is the lack of destructible landscape, which was one of the things that made Worms and games similar to it like it was. I have been unable to solve this problem at present, so I'll have to improvise....

The remaining issues would center on the weapon selection and spawning. In Worms you clicked on an object in the HUD, but Dim3 doesn't seem to allow this (as far as I know), therefore most likely I would have to use Choosers for that. However, I want them to be able to move the cursor, click on an area (which come to think of it is yet ANOTHER issue, but I believe ccccc already solved it), and have them teleport to or attack that location. But would I use obj.position.move(xAdd,zAdd,yAdd); or obj.position.place(x,y,z,ang)? I imagine I would need a way to get the coordinates of the destination and then have it move to said destination.

I also want it so that members of a team spawn in random locations, am I correct to use obj.position.placeRandomSpot for this?

I would also need a way to simulate the targeting crosshair; Dim3's crosshairs don't seem to function properly in third-person....


Wow, that was quite the rant. I hope one of you fine people can help me; if I can solve this, I think I finally have a working template in which to start. You've all been quite helpful already; and I am in your debt. Just a few more things to go, and we are almost there....
Sorry to tell you this, but a game like that is currently not possible in Dim3.
You will have to wait a long time until all the necessary features are added to even start on this project.
I recommend
a) Doing this in 2D (you could write your own engine, it's not that hard)
or
b) Switching to a different engine like Unity
Right now, Dim3 just isn't ready for that kind of game. It's more focused on action games like first person shooters and not strategy or role playing games.
Shazbot! Yet somehow I am not surprised.....


So, in other words, Dim3 cannot do a game like Worms, yet it has already been implied that it CAN do other types of strategy or turn based games. So perhaps I merely need to alter my focus a bit....



EDIT: Wait a sec, on the subject of the cursor, what if I tied it to the Player after all, but to solve the inability to pass through the landscape, what if I had gave it the ability to pass through doorways? That might work, assuming I could script doors that opens horizontally.....

You CAN do that, can't you?
If you really wanted to use the player as a cursor just have it fly above the map or make it pass-through. (turn of contact for player)
I tried using obj.setting.contact=false for the player model, but that didn't work for some reason.....


Having it fly is not the issue, the issue is, as you said, making it pass through the ground. One possibility is perhaps control the cursor through messages just like the other bots (something I plan to implement but haven't really started on yet); turning off the contact worked for the other models, it just didn't seem to work for the player itself....
Pages: 1 2
Reference URL's