I need some ai help.
#1
Posted 28 January 2002 - 08:25 PM
* 1 char
* Can hear weapons firing
* Will reload after 32 bullets
* Has a certain view distance, and CANT see through walls
* Takes random amounts of damage to a health total of 100 (about a damage range of 15-100 HP) upon being shot
The part I need the most help with is the view distance and the weapon noises.
Serious damage to important body parts pretty much ruins any plans you had for living. Bummer.
#2
Posted 28 January 2002 - 08:57 PM
There's gonna be a function in the robot's code that will repeat often right? (the kind that checks for which direction to go or something - if none are available, make one) Well, have it check for "spacepressed" (assuming that will be the firing button) and then check the x and y posistions to see if is in ear-shot. Then.. check the x,y coordinates to see wich direction the player is at.
BTW, you're pretty good, I've seen some of your games.
#3
Posted 28 January 2002 - 11:24 PM
I can't think of any way for the ammo without using extensive zapping of labels.
OWNZ ALL UR SPIN
#4
Posted 29 January 2002 - 04:53 AM
#5
Posted 29 January 2002 - 09:13 PM
WildWeasel, on Jan. 28 2002,21:25, said:
* 1 char
* Can hear weapons firing
* Will reload after 32 bullets
* Has a certain view distance, and CANT see through walls
* Takes random amounts of damage to a health total of 100 (about a damage range of 15-100 HP) upon being shot
The part I need the most help with is the view distance and the weapon noises.
Those are all relatively easy, And
1 char - that's uhm... nothing much
can hear weapons firing - Not only can you do that, but you can have it within a certain distance too
Will reload after 32 bullets - easy
Has a certain view distance - simple
Can't see through walls - That'll be the hardest, you could maybe check EmalkaY's Ai thingamajug, that was pretty cool
blahbalhglablablab - Easy
#6
Posted 30 January 2002 - 04:21 AM
#7
Posted 01 February 2002 - 04:23 AM
OWNZ ALL UR SPIN
#8
Posted 01 February 2002 - 05:29 AM
- Exo
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#9
Posted 01 February 2002 - 03:57 PM
#10
Posted 01 February 2002 - 08:13 PM
board_x, board_y, board_char, board_color
overlay_x, overlay_y, overlay_char, overlay_color
local, loopcount, local2 (mzxak2 only)
See? Eleven right off the top of my head. There's probably more though...
<+AFK> dormando's apathy is palpable.
* AFK palpates
<dormando> stop that
<Malwyn> undressing with revvy a little over a metre away. new definition of awkward.
#11
Posted 01 February 2002 - 09:24 PM
Revolution 8819, on Feb. 01 2002,19:13, said:
board_x, board_y, board_char, board_color
overlay_x, overlay_y, overlay_char, overlay_color
local, loopcount, local2 (mzxak2 only)
See? ?Eleven right off the top of my head. ?There's probably more though...
I hate to tell you this but almost all of those aren't local (or, writeable)
- Exo
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#12
Posted 01 February 2002 - 11:29 PM
Just use "loopcount" as the robot ID (each robot has a different number for that) example:
: "justentered"
set "loopcount" 1 <=== this sets the robot ID
set "HP&Loopcount&" 100 <=== MZX reads as "HP1"
set "Ammo&Loopcount&" 32 <=== MZX reads as "Ammo1"
: "loop"
if "HP&loopcount&" =< 0 "dietime"
if Ammo&loopcount& =< 0 "reload"
====Insert movement code====
goto "loop"
: "reload"
wait 10
set "ammo&loopcount&" 32
goto "loop"
: "shot"
dec "HP&loopcount&" random 15-100
goto "loop"
: "Dietime"
=== insert death code (give points/EXP/money whatever)===
die
That is the basic idea for robot ID's, I'm probably not the first to do this, but I've done it for over 2 years now.
Also If you want use the code that changes the robots name in the beginning if you want each to have a different name, mainly this is only if a robot will be copied, (like for an RTS)
@ "baddude&loopcount&"
In that event, just have whatever robot is doing the copying do this
: "justentered"
set "RobotID" 1
end
: "copy"
inc "RobotID" 1
copy block 1 1 1 1 2 2
send at 2 2 "startup"
end
Then have the robot that is being copied do this:
end
: "startup"
set "loopcount" "RobotID"
=== put in all the code to give it hit points and all that good stuff here ===
goto "loop"
I threw together an RTS doing this, it was pretty cool. You can also use the robot ID to track the X & Y coordinates of every robot that has one,
Just have the robot constantly do this (put it in a loop):
set X&loopcount& thisX
set Y&loopcount& thisY
This can be used to compare distance between two robots distance, direction, whatever.
The only real downside to all of this is that putting &loopcount& in every counter like that can quickly make robots large, sucking up that precious robot memory, so keep an eye on it.
Good luck on it, hope this helps a bit.
<Cybersilver> "All my sugestions are for FUTER VERSIONS. Say it with me Fu-ter futer. Yep..."
9-21-2009, SFMZX game play video: HERE
Risu2112
#13
Posted 03 February 2002 - 09:36 PM
Thundercloud
#14
Posted 06 February 2002 - 03:56 AM
Just thought of this.. u could use color of bot as a local counter.
#15
Posted 08 February 2002 - 04:32 AM
What I'm trying to accomplish is maybe randomized label zapping for the health points (ie. a :SHOT label would trigger ZAP "SHOT" &DAMAGE&, where DAMAGE is a random number 1-4) and DIRECTONAL based viewpoints (much like Metal Gear, only 3 lines wide and not 1 line wide. NES version, not PSX). It sounds complex...but I'm going for quality in here. Heck, my player weapons engine has a semi-auto pistol and a Sten SMG the overheats! (DONT ASK ME FOR IT. You can use it when TC+ comes out)
Serious damage to important body parts pretty much ruins any plans you had for living. Bummer.
#16
Posted 08 February 2002 - 04:39 AM
WildWeasel, on Feb. 07 2002,23:32, said:
I think that's been done before... using loopcount or local as a HP counter and then having :shot take 1-4 off of it would save a lot of memory, but then again, it's your game. If you'd rather use those counters for the vision thingey, go ahead.
And thus, I earn my 5th and final star, having made mostly intelligent posts along the way. *with a tear in his eye* I'd like to thank all the little people... *the screen fades out on him*
#17
Posted 15 February 2002 - 05:37 PM
Problem is I can't remember how its done.
#18
Posted 15 February 2002 - 10:42 PM
Frobozz, on Feb. 14 2002,16:37, said:
Problem is I can't remember how its done.
You can break up an integer into smaller integers on a little endian system (like our x86's) by ANDing off the high order/low order bits and if necessary shifting the high order bits into the low order. In MZX you can use modulos and division instead of binary AND and shifting. However, since the words in MZX are signed, so is division, so without some extra conventions you can't stuff 16bits. Most people just use 15bits. So for 7bit (high order, 0-127) and 8bit (low order, 0-255) unsigned integers you can do this:
set "value_1" "packed_counter"
divide "value_1" 256
set "value_2" "packed_counter"
mod "value_2" 128
Easy, yeah?
- Exo
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx

Help















