JazzJackrabbit Community Forums

JazzJackrabbit Community Forums (http://www.jazz2online.com/jcf/index.php)
-   Beyond Jazz Jackrabbit 2 (http://www.jazz2online.com/jcf/forumdisplay.php?f=8)
-   -   Jazz2 BOTS? (http://www.jazz2online.com/jcf/showthread.php?t=5409)

FQuist Sep 1, 2002 10:49 AM

For finding out the level, I got this idea:

Find out the height and width for the level.
Warp the bot to each one of the coordinates.
Now, if the bot isn't able to move at all, he's standing in a masked block. If he's able to the block is unmasked. If the ammo count for a weapon increases, you know he's the tile contains ammo. If he suddenly moves upwards or sidewards you know you hit a spring, belt or wind. To find out wether he's on a diagonal block, you can walk left or right and see if he also moves up or down.

This way you can create a ".ai" map of the entire level without having to code too much.

Trafton AT Sep 1, 2002 10:53 AM

Along with what FQuist said, the bot could warp to every single tile and see what happens to him on that tile to see what event there is there. A program could compile the results for all the levels in a collection.

FQuist Sep 1, 2002 11:44 AM

That's exactly what I said. ;p

Fawriel Sep 1, 2002 11:48 AM

But if he warps to every block once,he would just see if a tile was masked or unmasked,not if the tile shows a diagonal line(or something more complexe)!

Unhit Sep 1, 2002 09:45 PM

If it shows a diagonal line, he could get stuck, but was able to shoot. That was also a important thing when programming this programme, imho.

FQuist Sep 2, 2002 07:59 AM

If a block is masked you can warp to the block above and see if it's diagonal.

FQuist Sep 2, 2002 08:01 AM

Hmm, one problem. Doesn't jazz also get stuck when warped to a tile next to a masked block? Well, you can still find out by going to the tile near that one, and if you aren't stuck the other tiles aren't masked either.

Super Saiyan Sep 2, 2002 11:21 AM

So you guys are saying the bots have to warp in EACH tile in the level...? Hmm, well that would be a good idea but it would take long before the bot is ready, except if they can warp very very fast.

Trafton AT Sep 2, 2002 12:06 PM

Quote:

That's exactly what I said. ;p
Not exactly. This also answers Super Saiyan's question. I meant that there could be a program to automatically do this. It could store levels in a database. After all, the amount of levels often hosted isn't high. It would just have to do the scanning thing once.

Unhit Sep 2, 2002 10:39 PM

Quote:

Originally posted by Super Saiyan
So you guys are saying the bots have to warp in EACH tile in the level...? Hmm, well that would be a good idea but it would take long before the bot is ready, except if they can warp very very fast.
Everyone ough to have that programme then, and if he/she uploads the lvl to J2O, the levelcrator simply includes the .ai-file, so it is made ONCE and for all. Otherwise, every downloader had to make it for himself.

Matrix Sep 3, 2002 05:15 AM

Make a map
 
Couldn't you just create a mask of the entire level and save it as your own format?. The program could then read the file into an array and then the bot could place things like to cur pos of each player in the array to so it can then find a path.

for example:

1 = Filled in
0 = Empty
P = Player
B = Bot

111111111111111111111111111
1110000000000000000000000B1
111001111111111111111111111
1110000000000000P0000000001
111111111111111111111111001
111000000000000000000000001
..etc.

It could then find the path to the other player and shoot them.

Or for treasure hunt:
1 = Filled in
0 = Empty
P = Player
B = Bot
G = Gem

111111111111111111111111111
11100GGG00000000000000000B1
111001111111111111111111111
111000G00G000000P0000000001
111111111111111111111111001
111000000000000000000000001
..etc.

The user would have to do this them selves but with a simple editor could create a file with the level in its masked format. You could then create a program that hosts the file on a different port than jazz and when a bot wants to connect, it d/ls the file and connectes to the JJ2 server.

Now the hoster would have to create the file but standard levels could be created?

Just a thought...

Matirix

Neobeo Sep 3, 2002 06:24 AM

Firstly, the masking part shouldn't be too difficult... there's somewhere in the memory that does it :D and gives the whole 32x32 mask of the tile at that location

The hard part of making the bot, as some had already managed to pick out, is for it to actually find the path. Let's take Matrix's example for instance... its a simple path, but might take ages for a bot to just calculate that short path.

Let's say someone does manage to create some algorithm (probably some alien lifeform) that might allow the bot to find its way around the path... then there are also warp and trigger zones... so on the long run this is hardly possible...

Then if someone can figure out how to calculate the path of where the bot should take, then, well, there are many other limits (not exactly limits, but I couldnt find a better word) in programming which prevents the creation of a bot... *dont have any more examples currently*

So the closest we can come to a JJ2 Bot, as Overlord (i think) has mentioned, is just to "study" a player's movements and stuff for a few minutes and practically mimic it :rolleyes:

^^ Wow I didn't realise I've written so much.... lol

FQuist Sep 3, 2002 08:03 AM

Re: Make a map
 
Quote:

Originally posted by Matrix
[B]Couldn't you just create a mask of the entire level and save it as your own format?. The program could then read the file into an array and then the bot could place things like to cur pos of each player in the array to so it can then find a path.
[...]
That's essentially what my idea does, creating a mask by testing all blocks.

Neobeo: I barely know ai stuff, I can imagine pathfinding is hard. Easiest would be making an .ai file editor where you can put in paths

Newspaz Sep 3, 2002 08:18 AM

You could use an unused event as a path event. Like event 255

Link Sep 3, 2002 08:32 AM

If it did all work out, there would be another problem. The bot would be too good.

If it knew the position of every person in the level, then it would go to them. Regular players don't know the exact positions of other players unless they can see them. You can guess, but you can never know for sure until you see them. So A.S. (artificial stupidity) would have to also be programmed in the bots.

FQuist Sep 3, 2002 08:32 AM

But that way you don't know the level itself

Krezack Sep 3, 2002 08:38 AM

Quote:

Originally posted by Link
If it did all work out, there would be another problem. The bot would be too good.

If it knew the position of every person in the level, then it would go to them. Regular players don't know the exact positions of other players unless they can see them. You can guess, but you can never know for sure until you see them. So A.S. (artificial stupidity) would have to also be programmed in the bots.

We want some form of challenge don't we? ;-P

Trafton AT Sep 3, 2002 10:47 AM

Here's one problem:
The bot is playing battle1 and starts in the start position that you can't get out of without using a copter. However, the bot has no idea of this, so it stays in this area, and never goes off to play elsewhere.

The second problem:
Even if the bot gets the copter, it would have no idea what to do with it. It could say "all tiles on every side clear-moving right" and go off towards the bouncers instead of up to the water shield area. Since bots do not understand cause and effect, this would become a big problem.

Unhit Sep 3, 2002 11:03 AM

That's a big problem indeed.

Trafton AT Sep 3, 2002 12:16 PM

It would hard to "adapt" levels to this. For instance, while a bot could completely rock at Battle2, sending it to a Foo Races level would be a disaster. The only way around this that would not require a really really really complexly executed solution would be to tell it specific things about the level like "Go up, not to the right if you get a copter item on battle1." Of course, the programmers couldn't do this for every level that is hosted often. Thus, the bot would have a huge disadvantage, which is one of the various reasons playing bots were scrapped (no pun intended) after these issues came to light.

Unhit Sep 3, 2002 10:44 PM

I guess you also had to tell the bot before warping around if it's battle, CTF etc. If it should be CTF, he couls warp around and then look for short ways /ways where carrots are from one base to the other.

What I think that could be very difficult is to let the bot jump on the right places and not that he stops in front of a wall or something, but jumps out from his running. This way, he won't be that slow.

Anyways, we also needed two different scripts: one for Jazz, one for Spaz, as i.e. Spaz sometimes gets faster to certain places via his double-jump, while Jazz has to stand first.

Neobeo Sep 4, 2002 01:57 AM

Ok... let's just basically go through every function a Jazz2 Bot can have... Well, for a start it is possible to make the bot just stupidly run around and shoot when it "senses" a player within 10 tiles of it... But as I've pointed out there are too many limits

*never mind* every1 has gone through that... but anyway
1) masks - dats possible
2) sensor - dats possible
3) weapon choice - dats possible
4) path finder - dats half-possible
5) thoughts - dats impossible

what i mean by thoughts, is like... lets take this situation where 1 is wall, 0 is nothing, A is warp 1, X is warp target 1, C is warp 2, Y is warp target 2, B is bot, P is player

The bot obviously wants to get to the player

11111111111111111
10000000000A00001
10C000X0B00A0Y0P1
11111111111111111

the bot will just keep moving right in a neverending loop

artificial stupidity, like Link has mentioned also gives another limit
for example, many ppl use layer 3 in their levels to hide certain secret areas... but depending on how the bot is programmed, it either finds all secret areas or doesn't find any at all

my conclusion: lets say every1 on jazz2online knows programming and stuff and work on this for 10 years, and we combine all the code together, the bot still wont come 1% as close to a real human player :D

FQuist Sep 4, 2002 06:44 AM

We can try, at least. Even a stupid bot could be fun. He would be tricked by warps but would also be able to do things we can't do.

Neobeo Sep 4, 2002 07:28 AM

hehe... and the bot will win every test level with ease when everyone else finds it impossible

Cpp Sep 4, 2002 07:37 AM

Man! You people just can't solve anything on your own :D

Even if a bot would enter an infinite loop we can still record his pos and write a pos history log so the bot program can detect that loop and try something else.

Another (and probably better) solution is that we make/program some assault tactics (excluding combat and defence tactics in this example) so the bot will randomize (using RND) and try various assault tactics like running right, jumping right, kicking, etc. to reach and kill the player rather than just running right in an infinite loop like NeoBeo said. And so what' if bots are not close to real human players... Hey! They're bots. We play against the computer (AI) here. Even Epic was unable to program such bots (talking about UT here). They are computer-controlled players and computer needs no mouse/keyboard to control them. It's just like if you had your brain connected to the computer. ;)

Ow and I have to say that the mask thingie is a good idea. The bot should see only the same amount of tiles as every player sees on the screen.

Neobeo Sep 4, 2002 08:56 AM

ok... Overlord, so ur saying that the bot just does things randomly... well, it doesn't sound too bad, just that

its not too feasible because:
1) everything's pointed out already...
2) imagine a player who goes "up-down-left-right-jump-specialmove-buttstomp-etc." in an everlasting loop (random order) kinda irritating isn't it?

well, now that i thought of it, its not very possible for bots to be uhh... fully compatible... with new levels... so overlord's level.AI idea is quite a good one

*still searching for list of why bots are... well....*

nvm... ill post again sometime l8r, after some1 replies

Monolith Sep 4, 2002 07:31 PM

The best way to make a bot look as human as possible is to have it learn by watching other human players play. From tracking other players position, velocity, and status, the bot could learn the nature of the level and common paths it can take.

Neobeo Sep 4, 2002 08:45 PM

Quote:

Originally posted by Monolith
The best way to make a bot look as human as possible is to have it learn by watching other human players play. From tracking other players position, velocity, and status, the bot could learn the nature of the level and common paths it can take.
yea... this is a good idea... *if the level was err... stable (couldn't find a better word* because these days most levels use dectruct, collapse and trigger scenery and so on

so the original player takes one path
but the bot cannot copy that path because by that time the level would have "changed"

so in the end, the bot needs to "think" by itself after all

Unhit Sep 4, 2002 11:01 PM

Quote:

Originally posted by Monolith
The best way to make a bot look as human as possible is to have it learn by watching other human players play. From tracking other players position, velocity, and status, the bot could learn the nature of the level and common paths it can take.
Perhaps you even should get the problem reading EXACTLY out where the player goes, where he takes ammo and where he epsecially uses it. Of course, the "tester" shouldn't just shoot around for fun then, or the bot could get problems.
Othrwise, the bot should also wait at some places for respawning ammo/carrots. The only problem I see here is that you'd have to get a good player to create the .ai file then...

Cheeze Sep 5, 2002 04:14 PM

There are AI programs out there beging developed and although i haven't really taken a look at the code or anything, my assumption is that it could do some sort of primitive problem solving. This probably could be implimented into whatever masking stuff fquist was talking about, along with some system of finding out where players are, and then the bot can make simple decisions, like shoot at someone until he runs away, and either chase him, get a carrot, or do whatever he needs to do.

That's oversimplifying things, but if this ever picks up, taking a look at freshmeat or sourceforge might help out with the AI.

As for chatting, the coding is ridiculously simple, and i have some simple little programs around on my computer.

-cheeze

djazz Jan 5, 2010 05:57 PM

I was browsing the archive and suddenly...

Sry for bringing back this amazing thread, but I couldn't resist, I just love playing around with the GIP and other JJ2 bots :D
I don't know the status of this in your thoughts, but here comes some things I know and some ideas...

Just a "breakpoint": Should there be joining bots that download the level, read it, moves like a normal joining client OR an external program that either using the JJ2 window as host, or a special program that emulates JJ2.
I would suggest a host of JJ2, as this would give the most realistic movements, using JJ2's engine, and it could read the J2L/J2T files.

It is possible to make a joining bot at the moment, but it can't move and will get Connection Timed Out if server is running JJ2+. I'm sure there is a way to work around this, but then there is next problem: Proper physics. As the joining bot not have access to the sourcecode or a JJ2 window, this would be hard, to replicate the JJ2 movement engine.

And now, as the J2L and J2T file formats knowledge are increasing. Reading the level's mask, layer 3 (for hidden spots), all events and their parameters, and using the JJ2 as host, would make everything at least a little bit simpler.
Reading memory addresses is needed to locate ammo, players, carrots and other things.
But there is still much to do to make a bot actually act as a bot, and maybe the "copy player movements" plus some random decisions will make the bot more "alive", and somewhere to store all the data needed by the bot (".j2ai" files?). The bot maybe should run the level with different trigger states, destruct/stomp/collaps-scenery and/or find the most common paths, like a heatmap, and store it. It would also store the level's CRC so it can see if level hs been changed since the bot "learned" it.

Another good thing that FQuist stated was warping around the level checking mask and movement. Now the mask can be fetched from the J2L+J2T, then maybe just warp around and try different moves, and where they lead, and shoot and see where it hits. This maybe will lead to infinitive combinations.


I would be glad to hear your oppinion! O+

Crazy Rabbit Jan 6, 2010 02:15 AM

I have one idea...Make programmed bot file for Zaitox CTF...
But plz dont ask me how make bots...Im loser at this... :D

Lithium Jan 6, 2010 08:05 AM

We need a bot who can move around and play. If possible.

Stijn Jan 6, 2010 09:23 AM

What do we need it for?

Lithium Jan 6, 2010 09:26 AM

Uh,I don't know,maybe for a new gamemode or something? Players VS Bots server or whatever?

blurredd Jan 6, 2010 11:54 AM

I don't really support the idea of having bots join servers due to issues of being able to tell who is or isn't a bot, plus it should be only the server that decides if a game should have bots. Also, it's entirely possible to have bots produced by the server through JJ2. I haven't looked into the details yet, but it should easier to do nowadays.

djazz Jan 9, 2010 07:05 AM

Bots aren't the future, bots are today!
 
Quote:

Originally Posted by BlurredD (Post 454379)
I don't really support the idea of having bots join servers due to issues of being able to tell who is or isn't a bot, plus it should be only the server that decides if a game should have bots. Also, it's entirely possible to have bots produced by the server through JJ2. I haven't looked into the details yet, but it should easier to do nowadays.

Sounds good, to have bots hosted by server instead of joining ones, maybe a plus-feature in future?

I have now made a simple bot that using a JJ2 window as host and read player positions, who has flag etc. and uses "keyboard simulation" to move the player (the external program "press" keys on the keyboard to move the player). I've hosted a "Fight the BOT" server all day and it was a lot of fun, particularly the duels (player VS bot battle) or 2vs2 (players VS player and bot in CTF). The bot fires and jumps around, following the player.
I will improve it to make it defense bases, teamchat, find carrots, attack others etc.

[IMG]http://jazzjackrabbit.net/sgip/bot_01.png[/IMG]

As you see, the player uses position offsets, where 0x0 is at the player in target.
When the player is above the bot, the bot starts to jump, and when below, nothing. If the player is below and bot is on a vine, bot press down arrow to get down from the vine.
Health shows the bot's health. In future, the bot will start look for carrot when on low health.

To see the bot in action, please ask me and I can host it.

Crazy Rabbit Jan 9, 2010 03:39 PM

Ummm...Excuse me, can you make your bot to difficult...Maybe he will be make traps,camps or etc...

Troglobite Jan 10, 2010 07:28 PM

Quote:

Originally Posted by DJazz (Post 454415)
Bots aren't the future, bots are today!

I haven't seen the bot in action, but this idea amuses me immensely. Great job.

DanZeal Jan 11, 2010 11:09 AM

We would probably use a bot for Zeal Alpha if the bot could leave the server when it is more then 4 players or something and rejoin when it is less. Bots added to plus would be great.


All times are GMT -8. The time now is 04:52 PM.

Powered by vBulletin® Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
JCF © 2001-Infinity Jazz2Online