Main Menu

Finally...

Started by EgonOlsen, April 10, 2008, 11:08:22 PM

Previous topic - Next topic

EgonOlsen

#60
The bots act much better now. Still not perfect, but i can live with them for the moment. I started to create different tile sets. I'm not an artist...not at all. So bear with me...

Classic set:


Warehouse set:


Asia set:


Forest set:

fireside

click here->Fireside 7 Games<-

fireside

By the way, how does multiplayer work?  Do you need a dedicated server for that?  I don't know anything about it.
click here->Fireside 7 Games<-

EgonOlsen

No, the server runs on the client that hosts the game. You may as well start it as a dedicated one, but that would require to add the possibility to configure the server (map rotation, bots...) from the outside via some configuration file. I'll add that later, but not for now. If the server is running and bots should be used, the server spawns a bot client. It appears like a normal client to the server and to the other clients, except that it handles multiple players (=bots) in one instance, which the normal, interactive clients don't.

fireside

I haven't really played any multiplayer games because of my phone modem.   How does that work then, does one player download the game and then wait for another player to connect to his client server?
click here->Fireside 7 Games<-

EgonOlsen

You would need a central server browser for that (i.e. a machine that manages servers, a kind of server server). Because otherwise, no client would know who the server is and where it can be found. Without that, you would have to know the address of the server to connect. Anyway, this isn't my main focus. The game is intended to be played in a LAN. I don't even know if the network code will still work good enough in the internet with all it's lags and packet losses. In a LAN, you can make a broadcast containing the server data and all client in the same subnet should be able to see that server in their server list. We'll see how this all works out. For now, it works fine in my LAN... ;)

raft

i would like to hear about those bots. what are the goals and how did you implement them ? just for curiosity ;)

EgonOlsen

@raft:

Currently, the bots are not very clever. What they basically do, is to wander around in the level by choosing a random target and moving towards this target by using a modifed A* (very similar to what i used in Paradroidz). The target is, as said, either random or, with a certain chance, a collectable item. Walls and bombs act as a blocker for A*, crates don't (but they are bit more expensive than free tiles). If the bot is blocked by a crate on the calculated way, he drops a bomb and chooses a target in the opposite direction to escape the blow. Something similar happens when he runs into another bot (or a human player). When trying to escape a bomb's blow, the crates do act as blockers for A* to avoid a situation where a bot tries to escape one blow by blowing up another crate...that just didn't work very well in most cases.
While the bombs are blockers, the blow itself isn't. It's very expensive to cross it though. Basically, that's all they do right now (there are some minor tweaks and such, but you got the idea...). They don't try to hunt the player and they don't shoot (right now, every player can shoot...i'm not sure if this works well in that kind of game so i might remove or limit it later).
I guess they have to be improved to offer a real challenge, but for now, they act ok. Basically, they are meant as a kind of filler when you don't get enough players together for a decent LAN. They are not supposed to be real opponents. Here's a video that shows them in action (the player in the foreground is me, not a bot): http://www.jpct.net/img/proj/wip/bots.mpeg

As you can see, the blow themselves up from time to time. While this is realistic to a degree, i don't really know why this happens. It shouldn't. Then again, they place a bomb, escape and wait until the bomb explodes before moving on. There is no code that explictly triggers this behaviour...again, i don't know why they are doing this... ;D

raft

nice video. it is always fun to watch -especially self made- bots :)

so this is a continuous process ? bot calculates a path and follows it, then immediately calculates another and follows it and so on.. it places a bomb, calculated a path in opposite direction and calculates a regular path again ? what if it finds no path ?

EgonOlsen

Yes, that describes it pretty well. If it doesn't find a path, it simply doesn't move and tries again in some ticks. In those levels, this usually doesn't happen (except when it tries to escape a bomb where the crates are blockers.). Under normal conditions, there's always a path to take to the target tile.

raft

i see. doesnt that explain -at least some of the occurances of- why they blow theirselves and wait in some spot after they placed a bomb ? in that movie,  i saw a bot placed a bomb and stuck in next spot. nowhere to move because of the bomb. for waiting bots, it may the case that it found no path to a certain destination and waiting a few ticks for a new attempt

fireside

These pics make my applet look a little bad because I'm using small textures and ambient light to get maximum speed with the software renderer.  There might be a possibility I can do a webstart but I want to do it this way first.  I don't think shooting would be a good idea, but I haven't played the game much.
click here->Fireside 7 Games<-

EgonOlsen

Quote from: raft on August 07, 2008, 12:16:19 AM
i see. doesnt that explain -at least some of the occurances of- why they blow theirselves and wait in some spot after they placed a bomb ? in that movie,  i saw a bot placed a bomb and stuck in next spot. nowhere to move because of the bomb. for waiting bots, it may the case that it found no path to a certain destination and waiting a few ticks for a new attempt
Yes, something like that...but htey shouldn't move into those dead ends at all. It has something to do with costs. Walking two tiles along a blow into a dead end is cheaper than along three tiles into safety. I've added some code that should prevent this (with a chance that it gets ignored to appear more "human")...we'll see how it works out.

EgonOlsen

Quote from: fireside on August 07, 2008, 12:45:56 AM
I don't think shooting would be a good idea, but I haven't played the game much.
I'm not sure either. The problem is, that the model carries a gun and i can't modify it (lack of time + talent) in a way that it doesn't. The gun can be used to blow up bombs ealier, which may be a tactical element. You can also kill other players with it, but it's very hard to do so. So hard, that it doesn't make sense at all. So either i should remove the ability to kill others with it or make it easier. The former doesn't make much sense to the player IMHO while the latter may turn the game into a shooter kind of thing. It's difficult, but it think i'll get a good idea sooner or later.

fireside

The AI sounds like a lot of fun to work on.  It sounds like you're kind of building it into the path finding.  I have no experience at all in it so I wouldn't know, but it seems like it would be easier to make changes if you used a state machine and preference type choices.
click here->Fireside 7 Games<-