Game NPC AI ideas

Game development specific discussions.
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Game NPC AI ideas

Post by leopardpm »

oh my.... it won't even run on my system (I think my desktop is way too large), when I change the lines in the World constructor to this:

Code: Select all

    dim as integer  dskW = 1024, dskH = 800
    'screencontrol   fb. GET_DESKTOP_SIZE , dskW, dskH
    screenRes .7*dskW, .6*dskH, 32, 2, , 0
then at least 'something shows up - a window with a red rectangle around the edge and text that says "This is the World"....
don't know what you are trying to show me, but most of that code is beyond what I know.... I guess I am a basic Basic guy...

in any case, I do think you are still misunderstanding, but its OK, I think you will understand more once I get a simple simulation going

Have you ever played a city-builder? Kinda like an RTS game, but you only indirectly control the Agents. Existing game examples would be:

(1) Towns (free demo here: http://www.townsgame.com/index.php?opti ... 4&Itemid=5)

(2) Dwarf Fortress (description here: http://www.bay12games.com/dwarves/features.html) - I don't recommend playing Dwarf Fortress as the learning curve is intense and it is all ascii graphics...ug (there are mods to give it a graphical sheen though....)

Basically in these games there are a multitude of Agents running around, and they construct and do things as you command indirectly - you don't control each agent, rather you assign general tasks to be done (build something over here, dig a tunnel there, make a carpentry station here, patrol this area, etc...) and the agents figure out who will do a task (or multiple agents) and proceed to do them. The agents also have individual stats and variables that determine how sleepy they are (if tired, then they will stop working and go to their bed/house, etc), how hungry they are (if hungry they will go get some food), how hurt they are (if injured, they will seek medical attention, etc). They are basically micro-human(dwarf) simulations and the 'player' acts like the King or Overlord issuing commands.

The AI used is about 80% of what I am envisioning-I propose going one step further: remove the player from the overlord position, and replace him with an AI for each agent which determines their desires - Do they want to build a house? Do they want to build a better house? Do they want to be a Farmer? or a Carpenter? or a Blacksmith? These questions will be ones they themselves will answer, according to a Maslow's based AI. In addition, their local environment and economy will influence these decisions - and THEY will influence the local economy. Say all the Agents decide they want to be carpenters... well, most of them will not succeed(and starve!) because the goods made will be worthless to other carpenters... so some will then choose to be Farmers or something else. This cycle continues until a general market level of distribution is reached (say a population of 100 agents might end up with :15 carpenters, 5 blacksmiths, 30 farmers, 10 fishermen, 5 hunters, 15 lumberjacks, 10 Bakers, 5 Bar Owners, 2 Beer makers, 3 Beggars. This distribution, and the prices of every Good involved, is not set by the programmer, but rather by the environment and the 'personalities' and traits of the Agents themselves. AND, it is fully dynamic, meaning that the 'society' changes to adapt to new circumstances - a volcano explodes nearby, destroying all the local forests...poof... now the lumberjacks gotta figure out what else to do to put food on their plate, same to with the related professions (carpentry, etc). So, the player is removed from the game and it is just a pure simulation - what fun is that? Now, reinsert the player as an individual, just like another Agent and interacting with all the other Agents, figuring out how to survive and thrive in the economy/world. Basically an RPG in a dynamic world setting.

ALL of this depends upon having the agents interact economically (through trade and market prices). Determining prices in a truly free setting like this has been a bit of a conundrum, until I found this paper: https://pdfs.semanticscholar.org/e933/0 ... 5db6dd.pdf. A simple system for individual agents to determine market prices in a dynamic setting.... I have yet to prototype it in FreeBasic, but it appears easy enough....

ack! i always get off on these tangents.... sorry for the wall of text....
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: Game NPC AI ideas

Post by Tourist Trap »

leopardpm wrote:...
Unfortunately I think I don't get it well too much. In anycase maybe you will be interested by this link of a contest on agent programming:
https://www.ijcai-18.org/anac/
Prize
The prize money will be at least 500 euros for each league. The prize will be shared among the top agents - winners.
http://web.tuat.ac.jp/~katfuji/ANAC2018/
edit: maybe I already told you this? I'm getting old..
Gromow
Posts: 9
Joined: May 03, 2019 14:55

Re: Game NPC AI ideas

Post by Gromow »

Thanks!
Razgriz_101
Posts: 5
Joined: Jul 27, 2019 10:23

Re: Game NPC AI ideas

Post by Razgriz_101 »

I'm looking forward to your progress on this game, it does look like something that can be fascinating! I've just started dabbling with freeBasic, and it sort of helps me to see that some have gone forward and progress on their projects, to see the steps between "hey, I'd like to do a game" and the finished product with the hours and hours of work that were sunken in.

So, thanks for helping this newbie to not lose his willpower!
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Game NPC AI ideas

Post by leopardpm »

It can take alot of time, not just coding but also designing and thinking how diff parts will interact...vbut prolly my biggest time suck is troubleshooting.

Unfortunately, I haven't even tried to code since my car accident, have recover physically pretty good, but for some reason haven't been able to concentrate for very long on any particular topic.

I will pick it up again at some point
Razgriz_101
Posts: 5
Joined: Jul 27, 2019 10:23

Re: Game NPC AI ideas

Post by Razgriz_101 »

Oh, okay, sorry! Then first take care of recovering, don't overstress yourself, just make sure to write down the ideas you have during your recovery period so that you can implement them once you feel better!
Post Reply