Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

95
How can I model AI Interactions across the entire game world without computing them individually?
Post Flair (click to view more posts with a particular flair)
Post Body

I'm making a 2D top-down tile-based game in C using SDL2. The game uses a very large world map (think Dwarf Fortress).

My world terrain is generated using a noise function, another function is then used to build towns, model NPCs, etc. which are then saved to a local SQLite database (I'm using a database because NPC states, for example, are quite complicated - the database models their relationships with other NPCs, changing personalities, goals etc., and can be affected by player interactions with them as well).

At any point in time during play, the player is in some 'sector' of the world map. Currently, only interactions in the player's current sector are modeled (e.g. NPCs talking to each other, NPCs fighting each other etc.).

How can I model interactions across the entire world map, without the obvious computational problems of modelling every single interaction that occurs?

Is there some pattern which can generalise interactions?

The game uses time heavily (where a minute of game-time is a second in real-time, and thus in-game minutes, hours, days, months and years can be used). Could I somehow compute large-scale estimations of changes overtime? Some of these changes could be computed on player entry into the sector, based on how long it has been since the player has been in that sector (e.g. NPC getting older, dying of age etc.), but some changes should occur as they actually 'happen' (e.g. cross-sector things like an army or a trader travelling across the world).

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
25,351
Link Karma
7,431
Comment Karma
17,850
Profile updated: 1 day ago
Posts updated: 11 hours ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 years ago