-
Re: Future Contest Suggestions
I've now made a basis for the engine. It is pretty much your basic game engine: it targets 30 FPS for graphical display, it makes 90 ticks in second for internal operation (and DoEvents) to work smoothly and the rest of time time it idles (sleeps). There is no 100% processor usage. It gives me a constant 0% :) It is able to handle up to 32767 bullets and has gravity and pressure, so I guess we'll be shooting down a helicopter or an UFO.
-
Re: Future Contest Suggestions
Ok sounds good :) - if you get an engine ready - ill probably code for it.
-
Re: Future Contest Suggestions
Sweet! I'll PM Pino to start a thread in CC to gain interest. Maybe he can start a poll asking people if they would be up for it or not.
-
1 Attachment(s)
Re: Future Contest Suggestions
I need to test if this sceleton works with everyone who are interested. So here is the current source, see if it runs properly on your machine. It should give you 30 FPS and a bit less than 90 MPS (moves per second... didn't come up with a better name).
Todo:
- the object
- mode 1: human player movement for the object
- mode 2: some kind of scripting that allows the movement of the object via a premade script
- mode 3: (alternative) object AI, tries to get to the goal avoiding the gun shots
- the gun
- a simple class module that can be given as the base for coding the AI
Maybe I just make a common object interface for all that... it would be fun to control the gun too with a small code change :D
-
Re: Future Contest Suggestions
Looks cool. I guess the point is that those bullets are falling due to gravity? I didn't really have time to absorb all the code.
Yeah it definitly needs to be class-wrapped into an engine (eventually).
I'm not 100% clear on what the goal/plan is for this contest. I mean if the programmer gets TOO much info then it will get to a point where they never miss. Will the object be accelerating/deccelerating? Will we not know the direction/speed the object is moving and have to calculate it ourselves after getting info about its postion a couple times (maybe we (the gun) only get info every 3 seconds on the position of the target). Then we would have to plot its course and anticipate its movements.
What were your thoughts for it Merri?
-
Re: Future Contest Suggestions
BTW Merri. You are genius. You amaze me with your programming skills. You're really good at speeding things up. Like pre-calculating the sin/cos tables. I mean, your crazy. It's cool though.
Are you going to partcipating in the contest, since you are making the engine and all? Just curious.
Also, here is how I envisioned it:
* Engine does 99% of the work for the object's movement and all of the graphics work
* Programmer (gun) is only given limited info and has to make calculations based on that
* After calculations are done, the programmer throws back a few numbers into the engine and it shows what happened and then decides if hits were made or not.
The way you mentioned a base class module for the AI I was thinking that we wre thinking about it differently. Thats fine I was just hoping for some clearificaiton.
I was also picturing a more shell-oriented type cannon instead of a bullet-oriented gun. But either way is fine. I'm not saying you need to change it, I'm just kind of rambling because I have been thinking about this all night. I can't wait to get started.
Great idea :)
-
Re: Future Contest Suggestions
To clarify, yes, you get limited information. You never get too detailed information. For example, you won't know directly if the target is stopping to turn around: you get to know that it is looking elsewhere and you get to know the distance and angle in which way it is. But the AI must figure by itself if it is a good time to shoot.
Some cool features include that when you command the cannon to rotate, it will take a while for it to do it. You get the information about the changed angle, but you have to do things beforehand: you can't do two lines of code "turn around and shoot", because that would just start the process of turning around and shoots immediately. It won't wait until the turning is complete before it shoots. This gives you interesting possibilities: you could command the cannon to turn around one single time and shoot several times while it is turning!
The AI intelligence will be updated 90 times in a second, so the code can't be too sloppy or slow. Luckily most of it is just basic math.
I'm coding the basics right now, ie. the exact stuff you will be dealing with. I'm leaving room for improvement, so that I'll be improving and fixing the engine the same time you others code AIs. I don't have the time to think about the AI myself, so I can't participate :) You others can concentrate to the main thing: coding a great AI.
Edit Oh, and I fixed the issue of having too small FPS and MPS: they're both now constantly 30 and 90 (except if the computer is too slow, it skips stuff in that case).
Precalculating Sin and Cos is a basic thing to do, it was one of the first things that one can find in a game programming tutorial :)
-
Re: Future Contest Suggestions
Well I am still somewhat new to VB in the sense that I have only been at this about 6 months and I have only read 1 (and a half) books on the subject and that I havn't had any real training.
I am REALLY excited to do this context (have I said that enough). I am in Physics and Calculus this year and this is an awesome way to apply what I have learned. I think I'm going to talk my Physics teacher into helping me with this if I get stuck (although I don't think I will) because he is a big nerd and would love to help on a "video game" if you would call it that.
I like the idea of you working on the engine as we work on the AI. I don't really mind having to re-work my code to accomodate your changes as long as they are worth-while.
AHHHH! I can't wait!!! I wish I could rep you a million times for thinking up this idea and taking the time to write the engine. Major props man!
-
Re: Future Contest Suggestions
A couple other things that are kind of obvious but I thought I would throw out anyway:
* The most obvious one is to have the 90 MPS part (where the AI is updated) made into an event and you can declare the class WithEvents so you would end up with a cEngine_AIUpdate event that has to be exectured 90 times per second. (Did I repeat myself enough there?)
* Have an internal game timer so the AI can querey a .Time property so we can all be working with the same time. This helps when estimating the velocity of the object (if that is something we will need to do).
You mentioned the object will be flying. Will it also be accelerating and/or rising up and down? I guess it kind of has to be at some point.
-
Re: Future Contest Suggestions
Yes, I've thought about a helicopter. The cannon will be on ground and there is a helicopter that will try to fly from left to right. However, this helicopter will slow down or speed up, gain height or go down based either on user control, premade script (this makes benchmarking possible) or another AI. The funny part is that one of my challenges will be to figure out how to make helicopter stay still if nothing is done so that it won't fall to the ground!
There will be no WithEvents. You make the AI class and it will be linked to a sprite via code and it will run from there. You only code in to the one Sub. Nowhere else. Everything else is done for you, so basically if I change something, you only need to paste the new replacement code into your class module and leave your own sub as it is :)
This is what I currently have done:
VB Code:
Private Sub Sprite_Update()
' this occurs always when the sprite can decide what it should do
'
' this is where you code the AI
'
' Variables you can use:
' - LineOfSight: angle where the gun points
' - X and Y: sprite position on the playfield
' - ID: sprite ID
'
' Enemies:
' - Enemies(0 To EnemyCount - 1): current information about an enemy (DO NOT CHANGE HERE!)
' - GetEnemyCount: tells how many known enemies there are
End Sub
Uhhuh. Lots of information here. But it gets simpler once the background stuff is all working nicely. Yet one question: should there be obstacles in the way?
-
Re: Future Contest Suggestions
To make it more interesting - obstacles would be good :) - objects obscure vision too?
Though its hard to getobjects in the way between a cannon and a helicopter ;)
but you could have 'clouds' which obscure the vision of the cannon.
-
Re: Future Contest Suggestions
Maybe add commercial airliners that are landing as obstacles?..
Mmh.. maybe I should put my coffee usage down by a bit =)
-
Re: Future Contest Suggestions
Devion, Raedwulf, are you guys going to participate in this contest (it will be ported to .NET)? There hasn't been much interest in the Chit-Chat thread about the contest. Its always more fun with more people.
-
Re: Future Contest Suggestions
I'm for vb6 ( I think Merri would be too) - not .net :)
-
Re: Future Contest Suggestions
It will run in both langauges. vb6 and .Net (If I get more than 2 .Net users!)
-
Re: Future Contest Suggestions
-
Re: Future Contest Suggestions
How much left of the engine merri?
-
Re: Future Contest Suggestions
To be done:
- provide information about the surroundings (most importantly tell cannon about the helicopter)
- the helicopter
- fix an angle rotation bug or workaround by changing the method
- human control class, script control class and helicopter AI control class (the last one is what I do in my spare time once the engine is ready enough for your use)
If I do just the minimum requirements I might have it ready by tomorrow. I had a bad day today so I didn't do a whole lot, though did solve a few issues to make sure it is easy to find out if somebody cheats. There is a public sprite class which contains the details of all the sprites, and of course accessing that information from the AI class isn't a good thing.
Oh. The engine now supports 32767 sprites. So we could have extra category for shooting down multiple helicopters, or having multiple cannons and one helicopter. The benchmarking could be simply done by placing several cannons on the same spot: since the helicopter doesn't really get affected by the shots, it would be just like having all separate runs the same time. No need to do it all many times :)
Currently the sprite adding code is a bit messy, but it looks like this:
Code:
spriteCannon = SpriteData.AddSprite("Cannon", 100, 100, 128, True, New clsAI, App.Path & "\cannon.bmp", 16, 16, 16, 89, 29)
The interesting part is New clsAI. That is how you add an AI handler. I can also use New clsHuman to add a human controllable sprite, although that doesn't support anything else than shooting at the moment. In plain English: human controlling will be done via a same kind of class the AI is.
I'm tired. I'm off to sleep.
-
Re: Future Contest Suggestions
ok sounds good - sweet dreams :)
-
Re: Future Contest Suggestions
Looks great Merri. I can't wait to get my hands on it. I'm actually quite busy at the moment trying to finish my current project because I know that once I start this contest that is all I will be doing for a while. :)
-
Re: Future Contest Suggestions
I really like your idea Merri, and just wanted to say I think that, for a contest, a Defend AI would be better than an Attack AI, mainly because I see the cannon could make a perfect shot, but in the wrong time (the target could move away when the bullet is in the air), and finding WHEN is a good time and when its not, will be very relative. The best AI could fail just because couldn't GUESS the move.
In the other side, I think a Defend AI wouldn't have this problem.
Situation: The cannon is at some position, and the enemies shoots at it, then the cannon use bullets to destroy enemies bullets, that come from diferent enemies at diferent speeds/angles. The cannon that finalizes less damaged in a certain period of time is the winner. This also is much easier to test. The better AI will be the one that leaves the cannon in the better conditions.
-
Re: Future Contest Suggestions
That isn't really an AI, it is more of just pure calculation. I explained in the other topic why guessing (= thinking) is more of an AI. What makes someone a good shooter in the real world? What makes a good assassin? He can't know every possible move someone does. But a good assassin never misses. What makes him not to miss? This is where the fun of this contest is coming of, I believe :)
-
Re: Future Contest Suggestions
Objects that change speed and course are very hard to hit. That's why there are heat-seeking missiles out there.
-
Re: Future Contest Suggestions
Well, the helicopter won't be ultra fast. I try to find a good balance for how it works. And in the end, doing a perfect AI for this might be too good for a game (except if someone is a Finn... er, a masochist). Though I don't know if the engine will ever go as far as to become a real game. That can be thought about in the future.
-
Re: Future Contest Suggestions
Quote:
Originally Posted by Merri
That isn't really an AI, it is more of just pure calculation. I explained in the other topic why guessing (= thinking) is more of an AI. What makes someone a good shooter in the real world? What makes a good assassin? He can't know every possible move someone does. But a good assassin never misses. What makes him not to miss? This is where the fun of this contest is coming of, I believe :)
I understand you, believe me. But, I really can't see how you're gonna take care of the LUCK factor.
Example:
eyeRmonkey makes his AI. I make my AI.
You provide your Helicopter fixed path. The one that will be used in the contest.
The time it takes to the helicopter fly to destiny = 20 seconds.
The helicopter move fast 5 seconds and then hides behind a cloud for 10 seconds, finally it appears visible moving slow for the last 5 seconds.
My AI decides to shot during hte first 5 seconds, and do some blind shots behind the cloud, eyeRmonkey's AI decides to wait the best moment, and doesn't shot.
When time = 15 the helicopter come close the cannon being visible, My cannon has no more bullets but eyeRmonkey has his cannon full of bullets, then he fires all the bullets in the last 5 seconds.
He wins, he gets a better hit percent than me.
But that, was just because we used that object path, what would happend if the helicopter would move faster and going far, far away from the cannon in that last 5 seconds? I would be the winner.
Thats what I mean, things are relative to the object path of your choice.
An assasin knows when the victim will remain quiet, there are signs, here the only sign is the time left, but I don't think its enough. The results will be diferent depending on the object path of your choice.
-
Re: Future Contest Suggestions
We won't use a single path of course. There will be multiple ones made. Also, I've thought about not limiting the time and ammo, so the information you get is if the helicopter going to go off the screen soon. Sounds better?
Oh, and there are more signs than that! If a helicopter stops for some reason, it can't accelerate to full speed immediately. Changing altitude will also slow down it's speed. It is possible to measure what the helicopter will be doing by following the given distance and angle values. Storing and handling the information is up to you.
-
Re: Future Contest Suggestions
I'll prolly accept the challenge when it's ready :)
-
Re: Future Contest Suggestions
Then a question: I noticed having only 256 angles will give some headache on lacking accuracy. So... do people want two or even four times more accurate angles? This would allow better control on where the bullet could hit.
I've been tweaking the engine quite a bit. It now makes 400 internal processings in a second and rolls 40 FPS to the screen. This gives us accurate bullets and smooth control, but the AI can't be very heavy with its mathematics. This means any heavy calculations must be processed one command at a time. So a code like this:
VB Code:
For A = 0 To 255
CheckAngle A
Next A
Would be like:
VB Code:
Static A As Byte
' this will increase A by one and jump to 0 if it goes over 255
A = CByte((CInt(A) + 1) Mod 256)
' alternative would be:
'If A < 255 Then A = A + 1: Else A = 0
' then do the loop stuff
CheckAngle A
Though there are problems with this and it requires different way of thinking than the regular loops. You just have to make loops happen one at a time. You can also make multiple loops run simultaneously, so you can consider that as a plus. I feel people will need help with this, so I hope people are willing to help each other with this issue, even though this is a contest :)
-
Re: Future Contest Suggestions
1024 different angles tends to be the favourite of some old games/stuff I think.
-
Re: Future Contest Suggestions
Yeah, more angles would probably be better.
I hope people are willing to help, because from Merri's description so far, I am going in to this blind, but ready to learn. :)
-
Re: Future Contest Suggestions
I wonder what I've done today. It is like if the past 14 hours have been for almost nothing. This day really went fast and I didn't do much anything. Oh well, it is the independence day. But I really wonder where my day went. I didn't even play Civ III and still it seems the day is over for me already.
Maybe it is a sign of the shortest day of the year coming...
Humm... err... no.
Lets see....
- angle bug fixed
- angle improved to 1024 degress
- some kind of simple sprite animation added (follows angle)
- timetick added (can be used to follow time, similar to Windows' GetTickCount in a way)
- wrote a few forum messages about it and processed my thoughts further
Anyone know a good secretary? I might have a need for one. I can't even keep my own thoughts in order! :D
-
Re: Future Contest Suggestions
My secretary is named 3M (Sticky Notes ;)). I tend to forget what I wanted to post about in the time it takes the internet to start so I write a sticky note about it as soon as I think about it.
Sounds great. After the contest we should take the winners AI and turn the whole thing into a game. You would have the option of being the gun, or the object and we might be able to make 2 player also. The AI's would need to have difficulty levels added otherwise it would always be very hard for the human player.
-
Re: Future Contest Suggestions
Quote:
I didn't even play Civ III and still it seems the day is over for me already.
I used to be addicted to this and CivII :) - thank goodness that is over- dman Im playing Q3 now lol :D
-
Re: Future Contest Suggestions
For the alliance! ... WoW here :]
-
Re: Future Contest Suggestions
Gosh i was kinda addicted to War 2 for quite a while 7-8 years ago - so they have reintroduced the line 'For The Alliance' in WoW? - they forgot about it in War3 - but the elven archers in War2 used to say it.
-
Re: Future Contest Suggestions
It's a /silly (joke) for a few races I think.. the gnomes just yell For Gnomeregan when you do /charge :)
WoW is good, yet heavily addictive till yur lvl 60 and find that you need a bloody decent guild to go on.. :(
-
Re: Future Contest Suggestions
hehe :) - I hate MMORPGs because they are 'addictive'I keep on playing them for no reason until i finally delete them off the harddisk :). They tend to require time and not skill to paly - so I have resigned to FPS - and I used to play RTS games(but I'm not very good at them because I'm slow at learning hotkeys)
-
Re: Future Contest Suggestions
New Contest Suggestion: Random Comedic Post generator.
Please read all before you disregard. This could be an infinite source of fun and humor. The idea is to have a program all of us would install that executed everytime we logged into our own machines.
This program would shoot a random posting to VBF that is very humorous.
Each message consists of 3 parts:
"I need (code) / please give (code) / howto (code)" +
"Randomly generated technology" +
"randomly generated block of code (language randomized) / attachment of randomly chosen file from user's hard-drive / randomly generated VB project"
There is never any attempt for the auto-poster to give any code or problems of any specificity. Just fire off the random posting and see who replies!
Some examples could be:
- Hi I need a ieee 1394 Server.
- Hi I am new to vb.net [post random block of code - language unimportant]
- Hi I need to know how to print on check's using a receipt printer?
- Hi I need to konw how to printing on check ues a pos printer?
- Hi I need code to enter upc win I scann it. I scann into a text box and then enter it on http://www.upcdatabase.com/item.pl [post random block of code]
- Hi How to network a mac os 10.1.5 to windows xp home?
- Hi I need to know how to Access search for data? The code I need is for Access 2003. [post random block of code]
- Hi How to copy 3.5" disk to cd? Using vb 6.0.
- Hi I need to make a web page in php and search a my SQL database. For data in three the field. And right back to the database.
- Hi I need to search a Microsoft Office Access 2003. vb 6.0 for name of d.i. number. I have install mysql.
- Hi I need to know win a bid on ebay will be ending. Not in 24hr but 12hr. [post random block of code]
- Hi I need it to goto http://bob5731.no-ip.info/web [post random block of code]
- Hi How to clear a text box?
- Hi Coed will not show msgbox. [post random block of code]
- Hi How to stop downloading in windows xp home?
- Hi How to resize automatically?
- Hi How to open a web page in vb 6.0?
- Hi Need to save all the date in ms access 2003 forum www.upcdatabase.com code in vba [post random attachment from hd]
- Hi how to use a Adodc in vb 6.0 and ms access 2003. sm file is hare. [post random attachment from hd]
- Hi I need code to fix run-time error 62 ath not find in a text file.
- Hi run-time error 70 Permission Denied. How do I fix it. [post random attachment from hd]
- Hi I it want for the file to CHANGE. [post random block of code]
- Hi I need file not found code.
- [post random block of code] - no description of problem whatsoever
- Hi If the c:\pos\pole.dat is pole os I can open it. [post random block of code]
- Hi The cdoed in qbaisc and I need it in vb 6.0 [post random block of code]
- Hi How to make IBM ViaVoice 9 works with MSN messenger?
- Hi I have files that will all be changeing. So how do I put it in a loop. [post random block of code]
- Hi I need a wireless network monitor.
- Hi I need a cd-rom database to search cd's for files.
- Hi Can help fix the code or make a Report in vb 6.0? Ues Report files to help make the Report. [post random block of code]
- Hi I need to print to list box. File format for POLE.DAT [post random block of code]
- Hi how to make a FTP server in vb 6.0 for windows xp home
- Hi Can you all help get the code fix? [post random block of code]
- Hi I need hlep makeing a file using a input box? Exp you Enter Your name as bob the file will be bob.pos
- Hi Run the file Project11.vbp. Goto the setup menu and test it for me and fix for me if you wood. Can you all help me get the frmbarcode forum to Show. This writes the file [post random attachment from hd]
- Hi run-time error "54" bad file mode [post random block of code]
- Hi How do I make a Hit Counter for ny web page? [follow-up with: "Can you all make the file for me."]
- Hi I need to get data form http://www.upcdatabase.com
- Hi How do you get the week of the year? [follow-up with copied posts of replies from other posters]
- Hi I need to print SHIPPING label for the psup for free.
- Hi help form is not e-mail me. I will be useing http://www.no-ip.com my e-mail ir *****@sbcglobal.net I ueing Lil' http server.
- Hi I need Tic-Tac-Toe to use a network.
- Hi I need a clok Calculator. To take the ebay and the windows clok. Tale me win the biduing will to done on ebay.
- Hi help form is not e-mail me. I will be useing http://www.no-ip.com [post random block of HTML code]
- Hi I need a database for my pc shop. It need to take Phone and i.d. number.
- Hi I need to add check reading. It is for my pos. I need help makeing it.
- Hi I need the key code for [randomly generated pirated software]
- Hi free chat server and easy to setup in windows xp home.
- Hi I need web server for windows xp home.
- Hi I need my password fixed. I need it to get and put password in pos.pos? [post random attachment from hd]
- Hi I need to key code in windos and dos using in vb 6.0 for all the key and code to do it. [follow-up with: "BINOG"]
- Hi How to make a passwrod in vb 6.0 [follow-up repeating the word "password"]
- Hi how open the usb port in vb 6.0
Double-posting would be encouraged. The :mad: icon should always be used. The list could go on and on! When good-intentioned folks here at the forums start to reply, well hold onto your hats folks, that's when the fun begins!
Follow-up posts can be nearly identical to the original post, more randomly generated blocks of code, or clever replies like "No help yet", "how do debug it? ", "how do I do it?", "code no work", "no code.", "I not have code yet.", "Not working right.", "Is not working for me", "not work yet.", "Can you all help?", "!!!!", "How do I do.", "did not work.", "can you install for me. ", "what are doing?", "I need code to do it.", "no help.", "I can find it?", or simply "still no work"! Just parse the original post and reply with a similar variant! The fun never ends!!!!!!!!!
P.S. The poster's name should be randomly generated, too. Something like bobxxxx, where xxxx is a randomly generated number like, oh i dunno, 5731 for example...
-
Re: Future Contest Suggestions
Interesting idea.. though I doubt the Mods here are going to allow endless amounts of bull posts on their DB :)
-
Re: Future Contest Suggestions
Its a good idea Dave Sell, but, as Devion said, the mods won't like it at all. I also think the gun contest is more challenging. (EDIT: Ahhh... I get it. It was a joke. I'm an idiot. :))
Merri, how are things going with the engine?