Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  LevelOfDetail AI  (Read 3569 times)
0 Members and 1 Guest are viewing this topic.
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Posted 2004-09-22 19:53:51 »

Hi all,
Does anyone know how this is accomplished? I found references about "to make your AI System better, use LOD AI", but I can't find anything on the net regarding that.

Anyone know?

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #1 - Posted 2004-09-23 08:32:32 »

The most common way is using 2 levels of detail:

1. the neat one, which simulates everything you can think of and
2. the absolutly simplyfied one

If the enemy/rpc/whatever is on screen you use #1 and if it's off screen you use #2.

The silly one doesn't even need to follow your game rules strictly. Eg you have there 2 space ships, which try to shoot down each other... if they are off screen you just move their positions around (which you can see on your radar) and subtract ammo and shield of em every once in a while. So no chasing, no aiming, fuzzy behaviour... just some random number juggling which should *somewhat* reflect the outcome of a real battle Wink

弾幕 ☆ @mahonnaiseblog
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #2 - Posted 2004-09-23 13:01:07 »

but if you cannot see them, shouldn't you also make sure they are not on the radar? to avoid even "moving" as such?

Is that strictly lod tho? Because in graphics terms, lod applies to objects you can still see, they just have a lower face/vertex count because you can't distinguish the many faces from the rest....

I guess that also applied to AI, perform less operations if they are furthur away, but how would I be able to know which operations to remove and which ones to keep? For all the pc knows, the "moving" is the same as "moods"....

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Malohkan

Senior Member




while (true) System.out.println("WOO!!!!");


« Reply #3 - Posted 2004-09-23 13:12:01 »

That's what I'm gonna try with my game.  Now that it's time based instead of frame based, I can skip running a far off system for a frame and instead render it for double time next frame.  Half the calculations for a very similar effect.  Now I just have to think of how to organize it Smiley

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #4 - Posted 2004-09-23 14:46:22 »

whats the point malohkan? your still gonna run it twice which just makes up for that not ran frame.

However, if you could turn down the amount of calculations done per frame, with a flag perhaps, then it would be good. E.g. A calculation that must be done has a priority of 0. And one that is immediately take off as soon as the Agent isn't in view, set that to 1. And the second thing that is taken off from the calculations roster if its distance is 500 km away from the player...etc

So its basically a "resitance" factor. But how can this be done in a general, APIish sort of way?

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #5 - Posted 2004-09-23 15:04:44 »

Moving because it's visible on the radar... well it was just an example, where it make sense to move em around.

> Is that strictly lod tho?

lod=level of detail

Sure it's lod Smiley

>but how would I be able to know which operations to remove and which ones to keep?

It... uhm... depends Grin

In my example you have 2 very different things. Therefore you have 2 completly different kinds of AI. A neat one which all buzzwords you can think of and a... uhm... rule of thumb thingy, which just changes some numbers to approximate the outcome of a battle.

There are also games where enemys - once off screen - cease to exist or simply freeze.

Always remember that it's good enough if no one can tell that you have cheated Smiley

If no one can see it there is no need for making it look realistic. So instead of letting em aim at each other you just subtract ammo and shield energie accordingly to their statistics and some fiddling around. You could for example generate some tables filled with "accuracy" percentages. Eg with 10 ship types you would get 10 tables with 10 entries. You could gather em by running your usual ai for some minutes... the accuracy you get could be saved afterwards.

So whenever they are off screen and batteling against each other you let em shoot with their fire rate and their accuracy is used for calculating if it's a hit or not. You don't run any AI here - you just use your statistical data for determining a *possible* outcome of the battle (this is of course very cheap to calculate).

Well, it's your rules - you can break em all if you want to Smiley

You can always switch to a completely different/much cheaper AI if you want to.

弾幕 ☆ @mahonnaiseblog
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #6 - Posted 2004-09-23 15:13:23 »

well, i actually *just* implemented that feature in. ALL calculations that are done in my Engine are done via whats called "AgentActions".

Those literally do the thinking for the agent, its a simple class with one method, and one int variable. That variable will be compared with what the method's lod variable is. And if the AgentAction's levelOfDetail's int is greater than the entity's, then go ahead and perform that operation.

Is that the way its generally done? Also, can you please explain more about switching to a cheaper AI algo thingy that you mentioned at the very bottom?

If im understanding you correctly, that means when the LOD of a particular algo goes out of focus, then simply replace with a cheaper one? E.g. pathfinding, using A* upclose for accurate pathfinding, then just do navigational meshes or something like that?

Thx, DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #7 - Posted 2004-09-23 18:28:59 »

DP, you're looking at LOD-AI in a fairly strict, almost mathematical way. Which is good. Except...the game devs who coined the phrase were being far lazier than that Grin.

Quote

Is that strictly lod tho? Because in graphics terms, lod applies to objects you can still see, they just have a lower face/vertex count because you can't distinguish the many faces from the rest....


In graphics, all games have identical graphics engines...they are "merely" triangle-renderers. Hence, you can "invent" a LOD system that applies to ALL graphics engines, so long as it only works at a very low level (the triangles) which is common to all graphics engines.

Unfortunately, there is VERY little standardization in AI. Also, whereas 99% of graphics engines are tri-renderers, with only 0.5% being voxels, and 0.5% being sprite engines etc (hey, those aren't accurate, I'm being rhetorically extreme here Wink), in AI you get a more 25% - 18% - 9% - 8% ... etc split - i.e. there are no truly "dominant" AI implementations. Some things - like pathfinding - are widely used, and there are LOD algorithms for them in particular, although not always referred to as "LOD". But on the whole the phrase is more directed at the general concept of LOD being applied to AI rather than the specifics of a single re-usable concrete algorithm.

Quote

I guess that also applied to AI, perform less operations if they are furthur away, but how would I be able to know which operations to remove and which ones to keep? For all the pc knows, the "moving" is the same as "moods"....


This is the thing: with AI, you have to decide for yourself. Triangles are really very simple indeed, so when it came to inventing LOD algorihtms there wasn't much to play with; with AI, it's so incredibly dependent upon how your personal game's AI works that  it's much harder to make general observations...

malloc will be first against the wall when the revolution comes...
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #8 - Posted 2004-09-25 09:20:35 »

me...mathmatical  Shocked, neva!

I suppose its a good approach to have, but also a flawed one as AI behaviour isn't so mathmatical. Take POV-ray for example, it produces very realist images. But they are too realist, the shadows are crisp...etc. Purely mathmatical.

I guess i need to take a few drinks to get rid of that maths for a while Wink

But because im creating an API, it must provide extendability to be almost plug'n'play. So I sorta need to be awake then.

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #9 - Posted 2004-09-25 11:54:29 »

>Take POV-ray for example, it produces very realist images.
>But they are too realist, the shadows are crisp...etc.

Use another light type and use that noise stuff. Oh and there is also radiosity Smiley

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #10 - Posted 2004-09-25 15:35:56 »

1  
area_light <6, 0, 0><0, 6, 0>, 9, 9 


you mean to create soft shadows? Cheesy

hehe

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline Malohkan

Senior Member




while (true) System.out.println("WOO!!!!");


« Reply #11 - Posted 2004-10-26 20:04:32 »

Quote
whats the point malohkan? your still gonna run it twice which just makes up for that not ran frame.


Sorry for taking so long to reply...

What I'm doing is instead of
1  
2  
double ticks;
system[count].run(ticks);

for 6 frames, I'm doing:
1  
system[count].run(ticks*6);

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #12 - Posted 2004-10-27 10:14:37 »

that works fine if your algorithms are time based. And to be frank, most of them are. However, the time based are usually very trivial. Pathfinding is the big one without being time based.

For LOD to work with pathfinding, you must be able to "pause" the algorithm. Simply done by not calling a method and keeping the data the same. However, the big problem happens when the data needs to be changed between updates (say you update every 6 frames, the change occured in the 3rd frame).

The data needs to be changed, but when the algo is resumed, the data isn't the same as it was before, and  you end up getting inconsistant information, or information that is completely wrong!

I was it was as simple as your method malohkan, i really do :-/

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline Malohkan

Senior Member




while (true) System.out.println("WOO!!!!");


« Reply #13 - Posted 2004-10-29 03:11:24 »

In my case, if a change occurs, as in, a guy reached an objective in the 3rd frame, but now in the 6th he's passed it, well he just turns back the other way so it takes him a bit longer.  The idea though is that I've chosen to run him this way because he's far off and I won't see him, which means I don't care that he's acting like a drunken moron.  He'll get to his objective ok, it'll just take him a bit longer Smiley

In the case of an activity like, an event should have occured at frame 3, well you just don't respond to that event until frame 6.  It's just like there's a tiny bit of lag.  However, if you're giving such low speed priority to a group anyway, you should expect those sorts of effects.

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (23 views)
2014-09-12 09:08:26

Norakomi (56 views)
2014-09-10 13:57:51

TehJavaDev (69 views)
2014-09-10 06:39:09

Tekkerue (34 views)
2014-09-09 02:24:56

mitcheeb (56 views)
2014-09-08 06:06:29

BurntPizza (40 views)
2014-09-07 01:13:42

Longarmx (26 views)
2014-09-07 01:12:14

Longarmx (32 views)
2014-09-07 01:11:22

Longarmx (31 views)
2014-09-07 01:10:19

mitcheeb (39 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!