Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Advanced AI system underway...
Advanced AI system underway...
2002-04-08, 6:29 PM #1
Admins, please do not move this to the cogging section, I want people actually seeing this message :/


Hiyas ppl, I'm working on an advanced AI system to release for all to use. It is to replace the, uhh, 'lesser quality' AI systems JK comes with. This is a fully automated system that uses nodes. I'm looking for a co-COGger to work on this project, though I am able to do much of the work myself. Though I'm only looking for experienced coggers, I will explain how this all works for those interested.

Nodes are simply invisible positions to use as navigation points for AI Bots. It's the main way the RBots mod's bots move around, which is also why you must use the specially prepared levels that comes with the RBots mod. If the bot needs a powerup, the cog processes where the powerup is, and how to get there using this complex system of nodes.

What my concept and system does, is create these nodes in-game. Why is this good? A few reasons.
A) Eliminates the need for new levels (I had talked to Raynar about implementing this node system into RBots, he was interested but ended his work on the mod before I could really get started)
B) Cuts WAAAAY down on the level thing count (I will explain how later)
C) Allows the bot to create paths ON DEMAND - since the conditions in the level change rapidly (people being killed, powerups being taken, things being moved, etc) it can create a deeper sophistication of the AI Bot. (my bots will look for objects for cover, fire when the risk of being hit is lower, retreat if hurt badly, find and take powerups, etc)

How does my system save on the thing count (and some of you I'm sure are asking - what is a thing count?)
Well, the jedi knight engine can only have a certain number of things created in the game. Nodes (like in RBots) are just ghost positions all over the level - but they are still things. If you've ever played a build hax game and found you could no longer build or even shoot ur gun, you've reached the thing limit. While playing the actual game you wouldn't know the difference probably, but it takes editors a LOT of extremely tedious work placing these nodes. My cogs eliminate that.

How?

Well, it gets pretty technical, and if you have no knowledge of COG this will probably sound pretty rediculous to you.

My cog creates temporary nodes and does line of sight checking with the bot, the target, and other temporary nodes to make a connnection. The nodes are destroyed afterwards. Of course, you don't want your bot finding a path and not knowing it is through a pit of water. Therefore I have ideas and concepts of a cog subroutine called the N.E.R.D. (Node Environment Recognition Device) which does exactly what it means. It recognizes flags of surfaces, sectors, even lighting and textures to determine if the node in the path is safe to travel to. If it isnt, it tries to find another connection. This all gets extremely advanced even when dealing with 2 or more node LOS checking. Let alone when you combine that with the N.E.R.D. checking. Obviously it's taken in stages. The path creation will be completed first, the N.E.R.D. will be added second.

I'm looking for somebody good with COGging and perhaps more importantly, good with logic. Some of the node/path creation and LOS checking is boggling my mind, even with my prescribed ritalin and lots of caffiene pumping through my viens. I've rambled on about this all, but at least I've hopefully caught someone's attention (as opposed to a newb saying "yeah i wanna make a cool bad guy thing someone really good help me").


By the way, I don't think i've mentioned this is to be a single-player AI system only for the time being. I have no current plans to incorporate this into multiplayer bots.
2002-04-08, 6:48 PM #2
Also, heres a slight history of the project, though i havent really worked on it for a stretch yet (just an on/off thing i've fiddled with for quite some time now)

Almost a year ago, I had a crate successfully slide through an L shaped hallway toward another crate. This is pretty dumb, hehe, but it was the first step in developing the whole concept of the temporary node creation.

Next I tried to have the crate navigate two L shaped hallways, sort of like an S shaped hallway but slightly less complex. Basically, i was testing the use and path creation via more than 1 or 2 tempNodes. It failed and I gave up on the project for a while.

Worked on and off, tweaked this, played with that.

Created a single player allied AI cog using the single-node navigation to relocate the player (when following the player).

Recently, picked back up on the project.

Yesterday, Fred the ugnaught was born. Fred's cog was started over from scratch. Fred's final feat was to go from one crate to another around and around the room (to help establish a base structure to work around)

Today, I've started Fred's temporary-node creation and path creation subroutine based off information I gathered back from the crate navigating the hallway. Nothing too complex or special yet, but for me its all about starting it then "filling in the blanks."

My short term goal is to enable Fred to create paths using as many nodes as possible without either making my head explode with complexity or causing ANY strain on the CPU enough to be even somewhat noticable. The least thing I want this system to do is slow the comp down.

My longer term goals are to put in place the N.E.R.D. system, start the whole actual AI - retreating, attacking, finding cover, finding powerups, etc. Then taking it a slight step further and allowing the level author to choose whether the AI bot is friendly or not, as well as some other goodies like to have the bot follow the player or not. I would also like to put in place a ranking system that for once puts power in the hands of those imperial officers or the stormtroopers with the yellow shoulderplate. Yes - even chatting.
Officer: Stop that jedi scum!
Stormtrooper 1: Copy that
Stormtrooper 2: We've lost sight of him sir.
Officer: After 'im!
Stormtroopers: Yes sir!
2002-04-08, 6:48 PM #3
Sounds like a good idea.

------------------
Success is the inverse relationship between effort, gain, and loss.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-04-08, 6:50 PM #4
GBK, you want to help?
=D
2002-04-08, 6:55 PM #5
heres the cog if anyone wants to look at it. its pretty incomplete, i was just fiddling with the path_maker: subroutine and u'll notice a few things exist in one spot and not the other [http://forums.massassi.net/html/wink.gif]

symbols
message startup
message activated
message pulse
thing bot
thing crate
thing node0 local
thing node1 local
thing node2 local
thing node3 local
thing node4 local
thing node5 local
vector vec0 local
vector vec1 local
vector vec2 local
vector vec3 local
vector vec4 local
vector vec5 local
int maxvec=5 local
flex nodeSize0 local
flex nodeSize1 local
flex nodeSize2 local
flex nodeSize3 local
flex nodeSize4 local
flex nodeSize5 local
template noodle=ghost local
flex genericnoodle=0.25 local
sound grunt
end
code
startup:
player=getlocalplayerthing();
vectemp=vectorset(0, 0, 0);
for(x=0; x<=maxvec; x=x+1)
{
vec0[x]=vectemp; // clear vecs
}
setpulse(0.025);
return;

activated:
findme = crate;
path=0;
call path_maker; // create nodes, try to use LOS to make a connection!!
if(path == 0) return; // no path has been found, cancel
// NODES HAVE BEEN SET, GENERATE PATH INFO
busy=1;
job=1;
nodes=4;
curnode=0;
for(x=0; x<=nodes-1; x=x+1)
{
// if needed, add anti-crash checks here
if(getthingtemplate(node0[x]) != noodle) nodeSize0[x] = getthingcollidesize(node0[x]); else nodeSize0[x] = genericnoodle;
vec0[x] = getthingpos(node0[x]);
// node info set, destroy tempnode
destroything(node0[x]);
}
target=vec0[curnode];
return;

pulse:
if(busy == 1)
{
if(job == 1) call move_target;
return;
}
return;

# ----------------------------

move_target:
if(vectordist(getthingpos(bot), target) < (getthingcollidesize(bot)+(nodeSize0[curnode])))
{
// Arrived
curnode=curnode+1;
if(curnode == nodes)
{
// jobs done
PlaySoundThing(grunt, bot, 1.0, -1.0, -1.0, 0x80);
job=0;
busy=0;
return;
}
target=vec0[curnode]; // continue the path, move to next node
}
// Still moving
AiSetLookPos(bot, target);
AiSetMovePos(bot, target);
return;


// this is where the magic happens
// our target object should be findme
path_maker:
maxsurf=getsurfacecount();
for(h=0; h<=maxvec; h=h+1)
{
for(p=0; p<=maxsurf; p=p+1)
{
cursect=getsurfacesector(p);
tempNode1 = createthingatpos(noodle, cursect, surfacecenter(p), vectemp);
if((HasLOS(tempNode1, findme) && (HasLOS(tempNode1, bot)) { path=1; nodes=2; node0=tempNode1; node1=findme; return; }
// if one node isnt enough, add another

}
}
return;

end
2002-04-08, 6:56 PM #6
Id love to help, but Im currently doing an SP level...


But what the heck, I can squeeze in another project... [http://forums.massassi.net/html/wink.gif]

------------------
Success is the inverse relationship between effort, gain, and loss.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-04-08, 7:07 PM #7
i believe im about to show the first player-drivable vehicle cog ever completed (a beta version at least i hitched off Hellcat who had a copy from before my comp format) and im not talking about that cheap 3do model switching tactic swoop uses, this is the real thing - if anyone wants to play with it. Carbase is a force throwable object and Car is a _walkstruct object. both use the same model. place the carbase slightly UNDER the car model. This version does not have the headlights, car damage or other features the completed version had. I really wish i had my chopper cog from the JP:E project. That chopper even tilted in different directions when you flew it - as well as the lock-on hellfire missiles =)


# Cog concept and scripting done by BAH_Strike
#
#
#
#
#-------------------------------------------------------------
symbols

message startup
message entered
message exited
message trigger
message killed
message activated
message pulse

thing car linkid=1
thing carbase linkid=1
thing shifter linkid=2

sound grr
sound start
sound stickshift

end
#-------------------------------------------------------------
code
startup:
player = GetSourceRef();
StopThing(carbase);
DetachThing(car);
AttachThingtoThingEx(car, carbase, 0x8);
AttachThingtoThingEx(shifter, carbase, 0x8);
SetThingCurGeoMode(carbase, 0);
//ClearPhysicsFlags(carbase, 0x10000);
SetPhysicsFlags(carbase, 0x40); // stick to floors
SetPhysicsFlags(carbase, 0x10); // align orientation with floor - crumb doesnt work but ill leave it in
ClearPhysicsFlags(carbase, 0x4000); // is not affected by blast force - we dont need cars flying
driver = -1;
gearz = 1;
return;
#-------------------------------------------------------------
entered:
in = 1;
return;

exited:
in = 0;
return;
#-------------------------------------------------------------
trigger:
if(GetSourceRef() != 777) return;
blah:
PlaySoundThing(stickshift, car,5,5,10,0x80);
ChangeSoundPitch(strike, 1, 0.01);
if(gear == 5) gear = 6;
if(gear == 4) gear = 5;
if(gear == 3) gear = 4;
if(gear == 2) gear = 3;
if(gear == 1) gear = 2;
if(gear == 0) gear = 1;
if(gear == 6) gear = 0;

//gear = GetParam(0);
return;
#-------------------------------------------------------------
killed:
bbb = 0;
StopSound(strike, 0.1);
notin = 1;
speed = 0;
SetPulse(0.0);
return;
#-------------------------------------------------------------
activated:
player = GetSourceRef();
if(GetSenderId() == 2)
{
call blah;
return;
}
if(bbb == 1)
{
bbb = 0;
StopSound(strike, 0.1);
SetThingFlags(player, 0x300);
DetachThing(player);
speed = 0;
SetPulse(0.0);
sleep(0.06);
ClearThingFlags(player, 0x300);
return;
}
StopSound(strike, 0.1);
PlaySoundThing(start, car,5,5,10,0x80);
sleep(1);
StopSound(strike, 0.1);
if(in == 0) return;
strike = PlaySoundThing(grr, car,5,5,10,0x81);
AttachThingToThingEx(player, carbase, 0x8);
SetPulse(0.01);

bbb = 1;
return;
#-------------------------------------------------------------
pulse:
if((IsThingCrouching(player)) && (gear == 0))
{
if(speedy < 5*0.25) speedy = speedy + 0.004;
ChangeSoundPitch(strike, speedy+1, 0.01);
return;
}
if((!IsThingCrouching(player)) && (gear == 0))
{
if(speedy > 0) speedy = speedy - 0.0025;
ChangeSoundPitch(strike, speedy+1, 0.01);
return;
}
if((!IsThingCrouching(player)) && (speed > 0)) speed = speed - 0.0065;
if(!IsThingCrouching(player)) ChangeSoundPitch(strike, 1, 0.5);
if((IsThingCrouching(player)) && (speed < gear*0.25)) speed = speed + 0.004;
#
# I R L33T PWNAGE! W00T
#
if(IsThingCrouching(player)){ ChangeSoundPitch(strike, speed/10+gear/15+1, 0.01); SetThingLook(carbase, GetThingLVec(player)); }
lookin = GetThingLVec(carbase);
SetThingLook(car, lookin);
if(speed*gear < 0) return;
vel = VectorScale(lookin, speed*gear);
SetThingVel(carbase, vel);
return;
#-------------------------------------------------------------
end
2002-04-08, 10:42 PM #8
Its amazing to see what you, AN ALL THE OTHERS, can do with JK!!! Then belive what they can do with JO when they goes further in technology of Mod Making and such!!!
&lt;€(The Jedi does not know Evil.....or hate...Nor love..)€&gt;
*NJX PatentJedi*Jedi Knight Vice Patriarch and Avatar Designer at House of Core http://www.geocities.com/ein_miu_cor...useofCore.html
2002-04-08, 10:54 PM #9
hehe thanks. my imagination has been running short lately and I've been thinking about running almost like a business (for free of course, lol) of creating levels for clans to their descriptions. I did this, oh, like 1 1/2 years ago and it was a bunch of fun but apparently the clan died while I was working on the level LoL. I was still an editing n00b at the time and started to give up on the level after an elevator went totally bonkers and I couldnt figure it out haha.
2002-04-09, 12:09 AM #10
Fantastic! I really wish I could help, but unfortunately my cogging knowledge is limited to 'JKSetWaggle' [http://forums.massassi.net/html/biggrin.gif]
"Well ain't that a merry jelly." - FastGamerr

"You can actually see the waves of me not caring in the air." - fishstickz
2002-04-09, 9:30 AM #11
oh i get it. it's like you're "showcasing" a cog. no wonder nobody has gotten anal on you yet. this is really interesting stuff.
2002-04-09, 9:47 AM #12
Too bad. This belongs in COG; blatantly ignore the rules and forum descriptions, and you might find your posting privileges ..revoked.
A desperate disease requires a dangerous remedy.

A major source of objection to a free economy is precisely that it gives people what they want instead of what a particular group thinks they ought to want. Underlying most arguments against the free market is a lack of belief in freedom itself.

art
2002-04-09, 10:22 AM #13
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Strike1337:
hehe thanks. my imagination has been running short lately and I've been thinking about running almost like a business (for free of course, lol) of creating levels for clans to their descriptions. I did this, oh, like 1 1/2 years ago and it was a bunch of fun but apparently the clan died while I was working on the level LoL. I was still an editing n00b at the time and started to give up on the level after an elevator went totally bonkers and I couldnt figure it out haha.</font>


HAHAHH!! Well, U sounded like a noob tough...LOL!! I tried to make a LVL..it just was a LONG BIG Corridor wich was about....I dont know...160 CM thats kinda went more inwards the more in the corridor u went!!! I just tought...JEEZUS!! Il delete this cr*p right away!! I didnt understand a puck then.....
&lt;€(The Jedi does not know Evil.....or hate...Nor love..)€&gt;
*NJX PatentJedi*Jedi Knight Vice Patriarch and Avatar Designer at House of Core http://www.geocities.com/ein_miu_cor...useofCore.html
2002-04-09, 10:51 AM #14
Why does it belong here?
This forum is for basic and advanced cog help, he was showing his work.
2002-04-09, 11:04 AM #15
I was thinking the same thing. I have a reason to visit the cog forum now though...this intrigues me, I always wanted to do the same thing. But I'm afraid I know absolutely nothing about cogging.

------------------
"Rabbits will jump farther if you throw them..."
"Rabbits will jump farther if you throw them..."
2002-04-09, 12:27 PM #16
If you want any further info on how the
Rbots code works just let me know.

Raynar
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2002-04-09, 2:56 PM #17
DUDE!!! I might be able to help you, though you might have everything down
that I know of... I was playing with the idea of a gun that shot guided
bullets (like around corners and stuff) using waypoints. In mine you'd press
secondary to lock onto the player, and when you're locked on him, that
player produced nodes for the bullet to follow, so if he ran away, around a
corner or off a cliff, the bullet would know where to go. Exact same
concept... I wasn't sure how I could do it, but it might be another one of
those test projects to help out. If you need me, I just might be able to
give you my brain. I'm also in the works of creating a Vampire mod for Outcast
(working on a gothic cathedral map too). Do you plan on editng JO? Mail me if you're interested in my help. =)


[This message has been edited by Nergen (edited April 09, 2002).]
2002-04-09, 4:09 PM #18
Actally I already have a cog that practally does just this ..... with the help of SM.

Practally it compiles all the surfaces ID's into vectors of 9 per vector.

So if you had 81 floor surfaces (thats the amount in canyon oasis I think)

You could compile them all into 9 vectors for easy use later.

Then what it does is it takes the vectors and uses the floor ID's too find out using the Surface Vertex's the way to go to get to the place you want to ..... all temporally without having too create any thing's at all.

Of course it also takes into acount stuff like Jumppads, force jump, jumps, water etc... using surface flags etc...
2002-04-09, 6:14 PM #19
...ok, blu, don't hesitate to come back me up...
A desperate disease requires a dangerous remedy.

A major source of objection to a free economy is precisely that it gives people what they want instead of what a particular group thinks they ought to want. Underlying most arguments against the free market is a lack of belief in freedom itself.

art
2002-04-09, 11:19 PM #20
i don't think you can do it all temporarly when complex architecture comes into play...sounds interesting, though.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-04-10, 1:33 AM #21
Quote:
<font face="Verdana, Arial" size="2">i don't think you can do it all temporarly when complex architecture comes into play</font>


Dude i'm talking about floor surfaces, as I found out myself that practally anyone who doesn't know there way around a JK level, can find it by of course following all the surface vertex's, adjoined to each other ...

Thats how I think we should go about doing this...

Care to imput Strike ??
2002-04-10, 2:36 AM #22
How in the world would you find all the surfaces? Wouldn't that have to be in the level cog?
Cynic (sin'ik) n. One of a sect of ancient Greek philosophers who held that virtue is the ultimate goal of life, their doctrine gradually coming to symbolize insolent self-righteousness.

Drink So-Be, and play longer!
2002-04-10, 5:02 AM #23
For(I=0;I<=Getsurfacecount();I=I+1) I = YOUR_SURFACE_SIR;

------------------
Success is the inverse relationship between effort, gain, and loss.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-04-10, 9:59 AM #24
I was actually refering to Strike's way of manoeuvering. We all know that you are the COG god, Seifer, and would never dare to doubt anything you are producing. Sorry...that was...inadequate. Must...shut...the voices...so loud...can't see anymore...blood spills out my ears...noise get's even louder...muscles are weakening... __________________________________________________________________________________________

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-04-10, 10:18 AM #25
eheh... i guess i kinda jinxed it. sorry.
2002-04-10, 10:53 AM #26
I may be able to help... I'm fairly advanced in cogging; i haven't posted any of my work because it's just been too big of a project, and i end up abandoning most of it. As for having it just in SP, i would prefer it that way. I tried to modify Rbots for personal use to work in SP, but no way... Anyway, i can't make any promises, Strike, but if you are desperate, email me at darthreed@earthlink.net.

------------------
Vader: "Luke Skywalker, I know what gift you're giving me!"

Luke: "How, Dad?"

Vader: "Because I felt your presents."
2002-04-10, 3:28 PM #27
Quote:
<font face="Verdana, Arial" size="2">We all know that you are the COG god, Seifer, and would never dare to doubt anything you are producing.</font>


It's getting old. *_Seifer_* has changed a lot (for the better) since back then, in case you haven't noticed, and doesn't deserve the sarcasm. I'm 'relieved' that Emon was banned, since you *know* he would be on here badgering *_Seifer_* to death..
2002-04-10, 4:04 PM #28
Emon was banned?

------------------
The truth is out there, but so are lies.
2002-04-11, 2:43 AM #29
I know, I know. Sorry, Seifer. I was just feeling a little mad at the time...

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-04-13, 11:20 AM #30
Too bad I know nothing about COGging, of i would help

------------------
Look! A drifter! Let's kill him!
Stuff
2002-04-13, 8:05 PM #31
Jipe - Thank you so much, your've been the only person over this whole time who has backed me up when people like Emon were being real dicks. Thank you ...

zagibu - It's alright, I didn't mean to sound like how I usally sound ( like I know everything ) i'm sorry ...
2002-04-14, 4:48 AM #32
Gee, thanks admins for moving this to the cog forum *rolls eyes*

Show off your lastest work! Screenshots, sounds, weapons - anything welcome.

I think that should be changed to

Show off your lastest work! Screenshots, sounds, weapons - anything welcome; Oh except for COG.


Anyway, I'm flattered I'm getting such good posts here! Tho I'm wondering when seifer will stop posting in my threads saying he's already done it and it's 5x better (I hate jealous/competative people). Anybody who wants to help use strike_1337@hotmail.com for MSN and give me a message. I've been working on the node creation and dealing with some different ideas (IE: taking vectors instead of creating ghost-points and how that would effect the line-of-sight checking or how that could be gotten around).

I havent worked on it the past couple days. Im in debt with a lot of people in asherons call (I currently need to dish out 3,000,000 pyreals to people) and I've been trying to work that off.


Also seifer you can stop being so competative. I'm not trying to take your position of "COG God" so please lay off.
2002-04-14, 4:51 AM #33
Quote:
<font face="Verdana, Arial" size="2">Actally I already have a cog that practally does just this ..... with the help of SM.
Practally it compiles all the surfaces ID's into vectors of 9 per vector.
</font>


A cog that 'practically' does this. 'Practically' it compiles surface IDs?

I don't think its anything close to what I'm working on at all, 'practically' =D

Nergen, give me a buzz on MSN (strike_1337@hotmail.com) I want to discuss it further with you and see if you'd be a valuable addition. Same goes to anybody else [http://forums.massassi.net/html/smile.gif]
2002-04-14, 9:43 PM #34
Quote:
<font face="Verdana, Arial" size="2">Also seifer you can stop being so competative. I'm not trying to take your position of "COG God" so please lay off.
</font>


Oh my f*cking god strike ..... you are no better than the others....

Maybe it's just my way of writing, or i've been sterotyped like this... but i'm not trying to damn be competive or showoff my work , I didn't say it was 5x better then yours, I said i started work on something like what you stated.

All I wanted to do was to help .... but now I think i will pass.

[This message has been edited by *_Seifer_* (edited April 15, 2002).]
2002-04-14, 11:17 PM #35
From a third person perspective, Seifer's action is always like this.

- Someone posts an idea or a partly done cog
- Seifer comes in and tells "I have that cog", "I did in the past" etc.

Most people feel annoying. Please know that. And don't start crashing a good thread.

Go back on the topic please.

------------------
http://millennium.massassi.net - Millennium
JK Mods : Sniper Arena! - Enhancement Pack!
2002-04-15, 10:23 AM #36
Not to take sides, but Seifer's approach does seem to have some advantages. Although I'm not sure how well it would work in a level with lots of 3d0 architecture.

There is usually more than 1 solution to every problem.
- Wisdom is 99% experience, 1% knowledge. -
2002-04-15, 12:56 PM #37
Dude's ....... if you listened to me one bit you would find that I haven't already done this cog in any way .... all I was saying is that I was working on a method of compiling the floor surfaces into vectors for easy useage ... and that it may help Strike's cog if he uses this method.
2002-04-15, 4:28 PM #38
"This version does not have the headlights, car damage or other features the completed version had."

Strike, I still have a version of your jeep.cog that does have all these things. Contact me if you want it.
My favorite JKDF2 h4x:
EAH XMAS v2
MANIPULATOR GUN
EAH SMOOTH SNIPER

↑ Up to the top!