|
-
Apr 12th, 2001, 08:59 AM
#41
Thread Starter
Hyperactive Member
Originally posted by Beacon
I know this may sound stupid but what is AI?
Artificial Intelligence???
Names:
Tank Warrior
Are me
Obliteration
Destructabation
corny! i know!
had to get the ball rolling.
Well my vote goes for Obliteration!
As for the AI side. Yip it stands for Artificial Intelligence, but this is a very large field of interest. Much like saying oh, it's Graphics.... it covers a multitude of sins. This probably explains why it doesn't sound like your brothers project.
For any AI system to work it has to have a stimulous and environment. That is what we are providing here. The environment is akin to a humans 5 senses. In theory if you take a new born baby deprive them of any stimulus, then they would have no way of learning. This is not strictly a game.... it would be boring and laborious for a human to play, but it is more of a programming challenge. All we are providing is the arena.
What we are doing are providing a simple set of stimuli for the AI program, in this case the reports back from the tanks. We are then allowing the AI to control events and to try to outsmart another AI. For instance, if a tactic of chasing player two's tank results in that tank always heading back towards it's own territory, then the AI might make a reasonable guess that this is what it will do next time and send another tank to intercept.
For other AI projects the environment and stimulus could be quite different. For example a search engine might measure which items from a search people go into. Next time somebody searches for that, they could return the most popular results first. This is very simple AI. Despite what is mentioned earlier AI is not always about learning. An oft quoted example is the Turing Test (now I disagree with this as being a valid measure of intelligence - but that is my personal opinion), it only requires a program to fool a human into believing that he is talking to another human. Some might say that by rephrasing the humans input it is learning... that is a question of symantix, all computer programs react to input of some such.
I hope this explains matters, and if you want to join in your more than welcome, this is all about fooling around with computes and seeing what we can make them do. It's not at all serious.
Cheers,
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 12th, 2001, 09:01 AM
#42
Thread Starter
Hyperactive Member
Originally posted by spetnik
Why not use XML format for the files? This way they will be both easily readable by humans and machine?
Good idea!
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 12th, 2001, 07:26 PM
#43
Thread Starter
Hyperactive Member
Gerco,
Here's the code for the tank class
Code:
Option Explicit
Private miEnergy As Integer
Private mdAmmo As Double
Private msDirection As String * 1
Private miX As Integer
Private miY As Integer
Private miPlayerID As Integer
Private miTeamID As Integer
Private msInstruction As String
Private mbDead As Boolean
Public Sub SetUp(ByVal iEnergy As Integer, ByVal iAmmo As Integer, ByVal sDirection As String, ByVal iX As Integer, ByVal iY As Integer, ByVal iPlayerID As Integer, ByVal iTeamID As Integer)
Energy = iEnergy
Ammo = iAmmo
Direction = sDirection
X = iX
Y = iY
PlayerId = iPlayerID
TeamId = iTeamID
Dead = False
End Sub
Public Sub DepleteAmmo()
If mdAmmo >= 1 Then
mdAmmo = mdAmmo - 1
Else
mdAmmo = 0
End If
End Sub
Public Sub DepleteEnergy(ByVal iEnergyLoss As Integer)
miEnergy = miEnergy - iEnergyLoss
If miEnergy < 0 Then
miEnergy = 0
End If
End Sub
Public Sub RightTurn()
Dim iNewDirection As Integer
'
iNewDirection = InStr(1, "NESW", msDirection)
If iNewDirection = 0 Then
'//Error, but we'll reset the tank to North
msDirection = "N"
Else
msDirection = Mid$("ESWN", iNewDirection)
End If
End Sub
Public Sub LeftTurn()
Dim iNewDirection As Integer
'
iNewDirection = InStr(1, "NESW", msDirection)
If iNewDirection = 0 Then
'//Error, but we'll reset the tank to North
msDirection = "N"
Else
msDirection = Mid$("WNES", iNewDirection)
End If
End Sub
Public Sub Recharge()
'
miEnergy = miEnergy + 4
If miEnergy > 100 Then
miEnergy = 100
End If
'
mdAmmo = mdAmmo + 0.1
If mdAmmo > 10 Then
mdAmmo = 10
End If
End Sub
Public Property Let Energy(ByVal iEnergy As Integer)
If iEnergy >= 0 And iEnergy <= 100 Then
miEnergy = iEnergy
End If
End Property
Public Property Get Energy() As Integer
Energy = miEnergy
End Property
Public Property Let Ammo(ByVal iAmmo As Integer)
If iAmmo >= 0 And iAmmo <= 10 Then
mdAmmo = CDbl(iAmmo)
End If
End Property
Public Property Get Ammo() As Integer
Ammo = CInt(mdAmmo)
End Property
Public Property Let Direction(ByVal sDirection As String)
sDirection = UCase$(Trim$(sDirection))
If InStr(1, "NSEW", sDirection) <> 0 Then
msDirection = sDirection
End If
End Property
Public Property Get Direction() As String
Direction = msDirection
End Property
Public Property Let X(ByVal iX As Integer)
If iX >= 0 And iX < 32767 Then
miX = iX
End If
End Property
Public Property Get X() As Integer
X = miX
End Property
Public Property Let Y(ByVal iY As Integer)
If iY >= 0 And iY < 32767 Then
miY = iY
End If
End Property
Public Property Get Y() As Integer
Y = miY
End Property
Public Property Let PlayerId(ByVal iPlayerID As Integer)
If iPlayerID >= 0 And iPlayerID < 32767 Then
miPlayerID = iPlayerID
End If
End Property
Public Property Get PlayerId() As Integer
PlayerId = miPlayerID
End Property
Public Property Let TeamId(ByVal iTeamID As Integer)
If iTeamID >= 0 And iTeamID < 32767 Then
miTeamID = iTeamID
End If
End Property
Public Property Get TeamId() As Integer
TeamId = miTeamID
End Property
Public Property Let Instruction(ByVal sInstruction As String)
msInstruction = sInstruction
End Property
Public Property Get Instruction() As String
Instruction = msInstruction
End Property
Public Property Let Dead(ByVal bDead As Boolean)
mbDead = bDead
End Property
Public Property Get Dead() As Boolean
Dead = mbDead
End Property
I hope it is of some use!
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 13th, 2001, 03:47 AM
#44
Looks great, I'll adapt it to java...
I have a question: When a tank shoots, the shell should explode one turn later, right? Here's the problem:
Turn 1:
Tank1 shoots at 10,10
Tank2 moves to 10,10
Turn 2:
Shell Explodes?
Tank1 recharges
Tank2 moves to 11,10
Shell explodes?
See the problem? When does the shell explode? If it explodes at the start of the turn, tank2 is destroyed/damaged, but if it explodes at the end of the turn, it misses. Which is it?
Another thing, do tanks have damage? When you get hit, is it instantly destroyed, or damaged? How about blast radius, does a tank get damaged if a shell explodes in a square next to it? How many squares is the radius, by howmuch will the tank be damaged? Self damage?
A lot of detail questions still need working out...
I also plan to have ppl be able to submit queues of actions for a tank. Preprogram it so to say, that will be great if someone won't ba able to play for some time.
Gerco.
-
Apr 13th, 2001, 11:41 AM
#45
Thread Starter
Hyperactive Member
Originally posted by Gerco
Looks great, I'll adapt it to java...
I have a question: When a tank shoots, the shell should explode one turn later, right? Here's the problem:
Turn 1:
Tank1 shoots at 10,10
Tank2 moves to 10,10
Turn 2:
Shell Explodes?
Tank1 recharges
Tank2 moves to 11,10
Shell explodes?
See the problem? When does the shell explode? If it explodes at the start of the turn, tank2 is destroyed/damaged, but if it explodes at the end of the turn, it misses. Which is it?
Another thing, do tanks have damage? When you get hit, is it instantly destroyed, or damaged? How about blast radius, does a tank get damaged if a shell explodes in a square next to it? How many squares is the radius, by howmuch will the tank be damaged? Self damage?
A lot of detail questions still need working out...
I also plan to have ppl be able to submit queues of actions for a tank. Preprogram it so to say, that will be great if someone won't ba able to play for some time.
Gerco.
I would arbitarilly say that the shells explode at the start of the round before any tanks move, this way the AI has to make a guess as to where the tank is going to move next. Making it guess two moves ahead would be much much harder (far more variables).
For the time being I think we should keep it simple and if a tank gets hit it dies. I really like the idea of a blast area and this would work well with a damage level for the tank, but I think we should work our way up to these things. I was thinking that eventually we could have different levels of competition.
The basic system we are discussing now would be a good area for people to get involved and start off without having to worry about too many variables.
Then above that we have say another level that introduces Damage and blast areas and different types of tanks (long range guns, scout tanks).
Then above that we could add buildings (i.e obstructions both for movement and for visibility) and maybe even hills and valleys (you can see further from hilltops than valley bases etc. - great if the AI wants to co-ordinate an ambush). Recharging bases etc.
This way we could progress the AI routines without making it to difficult for anyone new to join in.
As for self damage, I think that yes tanks can damage themselves (and other tanks on their team), otherwise it would be easy to chase other tanks, 'cause they would have to avoid enemy fire while your own tank would be ignoring it.
What are your thoughts on a name? I kinda like 'Obliteration', but my heart is not set on it
Cheers,
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 13th, 2001, 11:51 AM
#46
Obliteration sounds cool!
I have some problems though... I'd like to make the server a command-line program. That way it'll run on many platforms, such as a linux server without a display.
I'm having some trouble designing though. I'd like to have something like a server console, when you start the server without any commands, you will be able to give commands to the server. That way it'll be easy to create games and add players..
I also want to be able to 'exec' command files, to add a lot of players or just create macros. Like the quake 3 console..
But I do have a little trouble designing a object hierarchy... how to make the server process commands to the tanks and stuff. Do you have any ideas on this?
Gerco.
-
Apr 13th, 2001, 12:09 PM
#47
Thread Starter
Hyperactive Member
Originally posted by Gerco
Obliteration sounds cool!
I have some problems though... I'd like to make the server a command-line program. That way it'll run on many platforms, such as a linux server without a display.
I'm having some trouble designing though. I'd like to have something like a server console, when you start the server without any commands, you will be able to give commands to the server. That way it'll be easy to create games and add players..
I also want to be able to 'exec' command files, to add a lot of players or just create macros. Like the quake 3 console..
But I do have a little trouble designing a object hierarchy... how to make the server process commands to the tanks and stuff. Do you have any ideas on this?
Gerco.
A command line interface sounds good.
The command files need only be text files that can be loaded in with say the following format
FileName = Normal.dat
-------------------------
XSize: 100
YSize: 100
MinPlayers: 2
MaxPlayers: 10
Teams: 10
TanksEach: 10
StartPower: 100
StartAmmo: 10
WaitForEntrants: 24 Hours
--------------------------
This could then be ran as a standard game such as
Code:
startgame normal.dat /wait=12 /xsize=200 /name="New Game"
so it would take the inputs from the normal.dat file, but they could be over-ridden on the command line.
P.S. The tinking with the WaitForEntrants would be the following logic every few minutes or whenever a new player joins a game.
Code:
If time_elapsed > WaitForEntrants and Number_of_players >= MinPlayers then
Start_Game
End If
If Number_of_players = Max_Players then
Start_Game
End If
Which brings us on to how does a player know when a game has started. Well my thinking on this is tha we either give the user a GUI for their AI apps which will check the server for games waiting and/or we allow them to leave their system on auto-join, where it will keep checking te server itself and when a suitable game comes up it will automatically join and run.
Cheers,
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 13th, 2001, 12:27 PM
#48
I tried to implement the server diffently, but it doesn't work 
Since there is no winsock, I tried to have the executable run only to process a turn.
But that failed... so I'll have to think of another way.. I think we need to work out a way for the server to receive information from the clients before I can write the server. We need to design first, code later.
I think FTP is a bad way of doing things, e-mail is WAY better, winsock would be the best, but since we don't have the facilities. I suggest we go with e-mail.
I think it would be a good idea to create .rc files, in this form:
GameBlah.rc
----------------
GameName Somegame
CmdFileDir C:\Obliteration\Somegame\commandfiles
StatusFileDir C:\Obliteration\Somegame\statusfiles
Logfile c:\Obliteration\Somegame\somegame.log
Gameboard 100x100
AddTeam Yellow
AddTeam Red
AddPlayer "[email protected]", Yellow
AddPlayer "[email protected]", Red
AddTanks [email protected],10
AddTanks [email protected],10
--------------------
Fill in a buch of other params and you have a configuartion file. The server can parse that file and create a gamestate file, that file can be used to process turns and write statusfiles.
What do you think?
Gerco.
-
Apr 13th, 2001, 12:31 PM
#49
Thread Starter
Hyperactive Member
Hi again,
As for the object hierarchy, I'm not sure if this is what you are looking for, but here goes.
I was thinking of having a new instance (or thread) of the server running for each game.
Within each instance we have a class called tanks.
Because each tank knows which player it belongs to we can put all of these into a 1 dimensional array.
So for 10 players with 10 tanks we need a 100 element array.
Thus:
Code:
Dim Tanks(100) as new tank
So player 1 joins and we assign him
Tanks(1-10)
Player 2 gets
Tanks(11-20) etc.
Each tank class also has a string property called .Instruction
As we read in the instructions from each instruction file we drop this into the relevant tanks .instruction property.
When the round is ready to be processed (either all the players have submitted instructions or a certain amount of time has elapsed), we randomly work our way through the array following the instructions of that tank.
Therefore we randomly pick tank 56.
We process it, and empty it's .instruction property.
We pick another tank 32 and do the same for it.
We pick another random number .. say we get 56 again, we look in it's .instruction and see that it's already been processed so we go to 57 (add 1), it has already moved so we go to 58, it hasn't done anything yet so we process it.
When all 100 have been processed we generate the output reports for each player and send them off.
The reason for this approach is that we don't want to give an unfair advantage to the players lower down the array. If two players are trying to move their tanks onto the same square, only one will succeed (and it will be decided randomly).
So we have a tank class with the following properties
.Energy
.Ammo
.Direction
.X
.Y
.PlayerId
.TeamId
.Instruction
.Dead
It also has the following methods
.LeftTurn
.RightTurn
.Recharge
.DepleteAmmo
.DepleteEnergy
This should suffice to record each of the tanks attributes.
To speed up processing, I would create an array of the playing field based on it's height and width
Dim arrayField (100,100) as integer
Then loop through the tanks array, and for each tank that is alive put their array index into the arrayField for their location.
i.e. If tank(32) is at 12,16 then we set
arrayField(12,16)=32
This way when we want to check if a shot has hit etc, we just need to look into that array.
Of course the array will have to be cleared at the beginning of each turn or after each tank has moved.
The basic playing parameters (size of field, etc) should be stored at the beginning of the match and never changed. The list of who is on which team only matters to the AI, if they want to take pot shots at ttheir own team mates then let them. It only becomes usefull for the server when we are checking to see if either side has won.
I hope this answers your questions, if not fire them back and I'll try again.
As for the name, Obliteration it is then! Cool.
Thanks again,
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 13th, 2001, 12:38 PM
#50
Thread Starter
Hyperactive Member
Originally posted by Gerco
I think it would be a good idea to create .rc files, in this form:
GameBlah.rc
----------------
GameName Somegame
CmdFileDir C:\Obliteration\Somegame\commandfiles
StatusFileDir C:\Obliteration\Somegame\statusfiles
Logfile c:\Obliteration\Somegame\somegame.log
Gameboard 100x100
AddTeam Yellow
AddTeam Red
AddPlayer "[email protected]", Yellow
AddPlayer "[email protected]", Red
AddTanks [email protected],10
AddTanks [email protected],10
--------------------
Fill in a buch of other params and you have a configuartion file. The server can parse that file and create a gamestate file, that file can be used to process turns and write statusfiles.
What do you think?
Gerco.
This looks good!
I'm happy with the e-mail way. It does answer a lot of questions.
My only thought with the param file is, how do we know which players to add. We almost need a two stage kick off. i.e. We announce a game on the website and people register (basically one click on a button) or preferably (in my mind) we give them a little GUI they can run that reads a file off the website announcing upcoming games. They can then pick ones to join and assign one of their AI's to it (I'm assuming that people will probably have at least two AI's i.e. One working and one in development). The server can then keep a record of who has been added to each game.
What do you think?
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Apr 13th, 2001, 12:46 PM
#51
Joining games is also one of my greatest problems...
All of this is not needed when we use winsock.. but I have a reasonable idea. We need a dedicated e-mail adress and some kind of processing program behind it.
To subscribe to the game (we can use an adress for each game), send an e-mail to the specified adress and the processing program can run the server exe and have it process the new entry...
But this also has drawbacks...
What do you think?
Gerco.
-
Apr 13th, 2001, 12:57 PM
#52
Thread Starter
Hyperactive Member
Originally posted by Gerco
Joining games is also one of my greatest problems...
All of this is not needed when we use winsock.. but I have a reasonable idea. We need a dedicated e-mail adress and some kind of processing program behind it.
To subscribe to the game (we can use an adress for each game), send an e-mail to the specified adress and the processing program can run the server exe and have it process the new entry...
But this also has drawbacks...
What do you think?
Gerco.
I can provide a dedicated e-mail address (and some web space until the server is up, but it's an ISP so we wouldn't have much control on the server side), but I suspect that you will only be able to receive e-mail from it, it probably won't let you send unless you're on the same service provider. I will e-mail you the details.
We could have a file on the website announcing games. The server could then effectiively update this page of HTML every time a match is added. (as a thought it could also update this page after each round and give a score of how many tanks are left for each player etc... but I digress ).
I could easily write a VB app for the client side that would read this HTML page and allow players to request to join a match. I could then fire an e-mail to the server with their request, and await a response.
What do you think?
SD
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Nov 9th, 2003, 02:23 AM
#53
New Member
Hey
Actually, for the sake of simply trying to clear some things up;
These project developers are using an Expert System (I think)... And I do believe that Expert Systems are a form of Artificial Intelligence in which the computer tries to solve the task at hand using specific and articulated hardcoded rules.
ps. It has come to my attention that this thread is over 2 years old. Whoops
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|