Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / a game.... help

Author
Message
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 13th Dec 2005 01:21

That's the code for my game so far. It's going to use a height map later on and an object for a wall around the heightmap. I need some good tutorials for ai. I just need simple ai for the enemies but i want allies too. I also want some commands for it
[i]I want
A. a unit selection program
selects the closest ally/allies with the commands "follow me", "move out", and "Attack" (attack-attacks the closest enemy while staying in a certain radius of your unit)
B. ally/enemy attacking units
1. enemy attacks the closest unit unless that unit is already under attack by a unit other than an archer.
2.archers knowing who to attack, running away from my their team's units if too close, knowing how far to throw the arrow
3.grouping together to prevent over-spreading
C. other stuff
1.how to do cow or chicken ai(for scenery)
2.burning system

I know that most of those arevery complex and i wont get most of the answers. Btw i may be posting in the newcomer's corner but im still good at programming since my dad knows basic and has been teaching me.

look, a signature!
made you look---------dancing penguins rule... you dont
devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 13th Dec 2005 22:41
keep it simple. darkbasic isn't c++. and sorry but there are no ai commands.

AI isn't hte hard part, it's pathfinding. if you're in DBC, it wont be very dynamic. if its on a matrix, it will be fine. if you're in pro, tehre are some astar functions in the codebase (it's a really clever algorithm for finding how to get to a place in the game, you just have to have them decide wehre to go)

start simple, don't give up, as AI is probably the hardest thing in game programming

as for the cow AI, if you're game's on a matrix, just have it turn a random direction ever once in a while and pause sometimes.

if paused# = 0 then move object cow, 1 or 3 or 5 every iteration
if rnd(100) = 1
yrotate object cow, rnd(359)
endif

and put if rnd(100) = 2 then paused# = 1

if paused# = 1 and rnd(30) = 1 then paused# = 0

if rnd(200) = 3 and sound playing(moo#) = 0 then play sound moo#

this makes it randomly wander and pause
it's just phseudo code tho

you'll have to work at it, but AI can make a simple hobby game fun, addicting, or even scary so keep at it

and btw, careful how much you ask for at once on here because some people's dorito crumb encrusted mouths frown at noobs who try that kind of stuff

verydevastating.com
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 13th Dec 2005 23:35
thanks for the tip. I know i'm asking alot and since i usually ask for alot i usually put something to the effect of: i know i'm asking for alot and i dont expect all the answers.

Anyway is there anyway i could use c++ to create a command for dbpro? I'm trying to learn c++ right now. Or if i could put the dbpro file into c++ somehow and use that? If you dont know much about c++ i dont really care.

look, a signature!
made you look---------dancing penguins rule... you dont
devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 14th Dec 2005 05:27
I'm pretty decent with c++. You can make dlls, but thats a little complex for someone who's still learning basic (not that you couldn't ). And in most cases, making something in c++ for darkbasic is the programming equivalent of teaching a tree to play paintball. If your dad knows some c++ you will want to learn that too. 99% of programming languages are made in or are a form of c++, so once you have that down, learning other langauges is waaaay easier. BASIC will look like english to you. Plus alot of great game engines use c-script (very much like c++) like torque and 3dgame studio a6, both of which are alot easier than raw c++.

But stick with basic fora while. Your game idea sounds pretty cool. Captain America was going to make a first person shooter like that a little while ago, maybe you two should team up.

peace
---Jeff

verydevastating.com
headcrab 53
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location:
Posted: 15th Dec 2005 02:15
One word of warning: YOUR SYNC RATE IS 100!

The main problem I see here is that your program will only run as fast as the framerate, meaning a frame rate of 30 would make the program run at one third the set speed. Older computers may not be able to run the game at 100 fps, and depending on the amount of power the game needs, maybe new ones wouldn't be able too either. The other problem is that when you're using full screen exclusive mode, the frame rate can't go higher than the monitor's refresh rate. My monitor is currently set to run at 85 hz, meaning that's as fast as the program would run. It's probably a good idea not to set the sync rate higher than 60.

"Not again!" - A Grunt
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 15th Dec 2005 02:49
ty devi&covenant. One problem is i've never heard of captain america. Could u tell me where to find him? I at least need some simple commands bcuz the extent of my ai right now is point the object towards you, move it. I know there are better ai techniques but i cant find them.

I am an eyeball and I live in Iowa; peter piper picked a pick of pickled peppers;"aren't you a little big for the SIDEWALK";hello, i am an eyeball.
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 15th Dec 2005 03:17 Edited at: 15th Dec 2005 03:19
try this tutorial it sould teach you a bit about A.I. if you can understand it
http://forum.thegamecreators.com/?m=forum_view&t=63411&b=7
devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 15th Dec 2005 03:44
you're goign to have to move and piont the enemy to move him anyway, it's about where you move him to and what he does that matters. a good way is to devide your level up into zones (using arrays for the x and z or putting a plain under each object and checking the intersection to determine it) and have the ai go to certain zones depending on where the player is (i.e. in a building, in the front yard, in the side yards, in the back, in the street in front). I did some AI like this a little while ago for a demo and made it open source. you're welcome to use it.

http://www.verydevastating.com/dmhsource.zip

btw you don't "find" ai, mostly because it's very game specific. AI is nothing more than moving objects around and making them point at you and move a bullet towards you sometimes.

the only other real "tequnique" is scripted events, like maybe you place an object and hide it just before the a corner, adn when the player collides with it it activates AI, making... AN AMBUSH!!!

and as for captain, I've only seen him in the DBC boards so check there.

hope i helped
---Jeff

verydevastating.com
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 15th Dec 2005 23:42 Edited at: 17th Dec 2005 00:07
hmm. Thanks jeff. one problem is that whenever i play it, it "cannot load sound at line 30" i unzipped it n stuff but... My dad has programmed in basic alot and has made ai for it. He says another way you can do it is to write a program that calculates something to make a tree then acting upon that tree. Any words on that? I know that people shouldnt get started on stuff like this so soon but hey, i want to get a job in comp programming and learn-
html, xml, dhtml, java&javascript, c++ and basic. I know i'm setting my goals a little high but hey, i have about ten years or so to learn that stuff before i want to get a real job. At the rate i'm going i should have mastered all of those in 15, 17 years.
also for jerok. thank you but i've already looked at that and understand it. but i need a program that judges the options not just go in circles until someone comes near and then closes in on it(i know that the range could be used for shooting).

dont respond to my threads- Ruccus, smoked
devastation
19
Years of Service
User Offline
Joined: 11th Aug 2005
Location:
Posted: 16th Dec 2005 02:18 Edited at: 16th Dec 2005 22:46
hmmm. i must have included an older copy of the media for it with the source than with the real game. try this one (the exe) http://www.verydevastating.com/dmhunt.zip

as for the tree, it's a great way to do it tho I've not needed ai taht smart for any project i've done yet. i'm assuming he's told you what it is but if not, it's kind of like a flowchart

if this AI bot is active:

1) if the he doesn't nkow where the player is then wander

2) if he does know

a) if the player isnt shooting then creep up
slowly (the player probly doesn't know its there)

I) if it's close, attack

B) if the player is shooting

I) attack if the AI's health is > 30%

II) go towarsd another AI bot if it's less than 30%

III) when close to an AI bot, it "tells" the ai
bot about the player and they both attack

it "branches" out like a tree. these are extremely efficient and the code for them can be small if you put alot of the main code for this into functions. its important to keep the trees organized tho, and not get too crazy with the ai. also, try not to have you're monster "think" too much. just make it pick somewhere to go or someone to attack and go for it.

and you're probably going to be a brutally awesome programmer by the time you go into the field. and you might as well get started on stuff like this now. it might get frustrating some times if you're starting above your skill level but stick with it and you'll get better alot faster than the people who make 30 programs to learn 1 function inside and out.

html is pretty easy, java's not bad if you already know how to program. c++ is the only real tuffy, but once you get it, you'll be able to program virtually everything but assembly.

uch. god i love ai.

hope this helps
---Jeff

edit:

btw you might not want to put your age on here. this is probably the safest forum on the internet, but still some people will take you less serious the younger you are.

and my indenting got messed up so i numbered and lettered instead

verydevastating.com
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 25th Dec 2005 04:53 Edited at: 25th Dec 2005 05:34
ty. Also you said that there are no ai commands.I didnt mean have a command that was
if state=1 then attack(current ai object)
i meant to make a command that makes the object follow you. i'm guessing that it has alot to do with what it does, select the closest allies, make your allies follow at a certain distance or just stay in an area that was a certain distance around you while carrying out its normal actions. Move out would just be move out of that radius, Also make a small radius around each enemy and have at least one unit go in that radius unless the object was an archer/ranged unit, horse/cavalry/vehicle or a special unit. So, correct me if i'm wrong but alot of the ai commands except maybe some pathfinding commands n stuff, are all about radius.
[edit]
Also i examined the code more carefully and realized something really obvious-its only simple game logic, the equivalent of if statements except maybe a step up. AI judges all possible moves from the enemy and itself and judges those and then moves itself.

santah my god, theyre real! *santa faints*
red m&m:oh my god, hes real!*m&m faints*

Login to post a reply

Server time is: 2024-09-24 11:27:08
Your offset time is: 2024-09-24 11:27:08