Mythruna
April 18, 2024, 04:09:34 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: More Global Resource Dependency stuff...  (Read 27828 times)
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« on: July 09, 2012, 12:51:30 AM »

A pic of a little more progress on the global resource system tester.  Here we see a town with some random citizens and some early production-capable buildings. 


I've implemented a very basic name generator for towns and people just so I don't have to enter them all the time during testing.

The original AI tester used its own simple entity system but this weekend I converted it over to use the same one the real Mythruna game uses... so I got some fancier features internally and automatic persistence.  The latter of which is kind of nice now that testing setup is getting more complicated. Smiley

Now that buildings can understand about their outputs, the next thing will be giving them a list of required inputs.  After that, I can start mapping requirements to resource production and figure out how well the town is operating.
Logged
FutureB
Donators
Hero Member
***
Posts: 512


RAWR


View Profile
« Reply #1 on: July 09, 2012, 03:40:12 AM »

it is looking better and better paul :] keep working on your amazing ai
Logged


Say the opposite of these words:
1)Always.
2)Coming.
3)From.
4)Take.
5)Me.
6)Down.
Teknonick
Sr. Member
****
Posts: 438


View Profile
« Reply #2 on: July 09, 2012, 05:49:46 AM »

WOOOH! I hope you release a version of the AI tester :3 CHICKEN INVADING YER CASTLES!!! (And if you set them up right, looks like its water spilling downwards :3)
Logged
BenKenobiWan
Friendly Moderator
Donators
Hero Member
***
Posts: 674


Jesus loves you!


View Profile
« Reply #3 on: July 09, 2012, 06:56:56 AM »

The Mythruna entity system gives you automatic persistence? What does that mean?
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #4 on: July 09, 2012, 09:04:13 AM »

The Mythruna entity system gives you automatic persistence? What does that mean?

It might be hard to explain without getting too technical, but...

"Entity Systems" are a sort of game architecture.  Basically, every object in the game is an entity... and an entity is a container for "components" which are like pieces of data.  Parts of the game operate on entities that have certain components, ie: contain certain types of data. 

For example, in Mythruna a placed object has components: Position, Mass, BlueprintRef, etc..  The renderer grabs all entities with Position and BlueprintRef and makes them objects in the scene.  If it sees a new entity that meets that criteria then it displays another one and if one of its existing set has one of those components removed then it removes it.

As an easier to explain example, in the above picture all of the rendered "objects" are entities that have Name, Position, and Icon components.  The renderer doesn't care what they are.  Every time the screen is repainted it draws all entities with Name, Position, and Icon.  This was really convenient because I'd already written the renderer for the creatures.  I had nothing else to do to support buildings and towns.  They are objects with a bunch of town and building specific components but as soon as I gave them Name, Position, and Icon the renderer happily painted them on the screen.

(Likewise, an interesting side effect is that the part of the adaptive pathfinding system that prevents objects from penetrating each other also magically worked for buildings... so right now a creature can push a building around which is kind of funny.)

Anyway, when I wrote the original AI tester I just cobbled together an entity system that ran in memory and it's features were very limited (a simple one is really easy to write). 

Mythruna's entity system obviously has more features as I use it for everything in Mythruna.  One of the features it has is that it automatically stores entities and their components to a database (in mythruna.db/entities in the full game).  So when I converted the AI tester over to Mythruna's entity system then I got this automatic storage.  The tester now remembers where everything is from one run to the next.

Towns are getting harder to setup from scratch so that's really useful for testing.
Logged
Ghelmaron
Donators
Jr. Member
***
Posts: 76


View Profile
« Reply #5 on: July 09, 2012, 04:36:03 PM »

Looking good, Paul!

Heck, what you have right there in that screenshot looks like a game on its own  Wink
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #6 on: July 09, 2012, 06:18:37 PM »

Looking good, Paul!

Heck, what you have right there in that screenshot looks like a game on its own  Wink

Thanks... yeah, I think the same thing sometimes.  I'm not sure it will be "fun" as a game but there will be stuff to do.

When it gets to a certain point, I'll release it to the donators group and let people play with it.  Maybe setting up town networks and then breaking them to see what happens turns out to be fun.  Though the final version will probably be on a mythruna map instead of the little AI tester block map... since in the real final version I want to play with random town placement, too.
Logged
Teknonick
Sr. Member
****
Posts: 438


View Profile
« Reply #7 on: July 09, 2012, 06:36:38 PM »

Maybe you could make wild fires, and maybe wild monsters (Non-wild anyone?)! Could have random events.... A NEW GAME! MADE REALLY QUICK, AND IT WAS USED TO MAKE ANOTHER GAME! lol :3
Logged
BenKenobiWan
Friendly Moderator
Donators
Hero Member
***
Posts: 674


Jesus loves you!


View Profile
« Reply #8 on: July 09, 2012, 07:45:15 PM »

I'd rather he not get sidetracked making a mini game, other than to have a change of pace if he needs it.
Logged
Teknonick
Sr. Member
****
Posts: 438


View Profile
« Reply #9 on: July 09, 2012, 08:07:23 PM »

I'd rather he not get sidetracked making a mini game, other than to have a change of pace if he needs it.
True, but hes gotten this far, in such a short time! And he will have to keep improoving it to make his AI better... Still want Mythruna more than anything :3
Logged
ahmadsal
Jr. Member
**
Posts: 90


View Profile
« Reply #10 on: July 09, 2012, 09:05:20 PM »

Now that buildings can understand about their outputs, the next thing will be giving them a list of required inputs.  After that, I can start mapping requirements to resource production and figure out how well the town is operating.

So I see that you have the road layed out in front of you now but I'm just curious, the player will be able to construct objects in the final version. However, how do you plan to allow players to build their own buildings.

 (My thought would be similar to blueprint editor but in the physical world, with predefined objects of specialty, sawmill furnace etc, and hopefully the ai could navigate)

 I see you taking the a method highlighting object properties instead, which would make it easier to autogenerate but in my opinion harder to manually design something unique but recognizable for ai.
Logged
BenKenobiWan
Friendly Moderator
Donators
Hero Member
***
Posts: 674


Jesus loves you!


View Profile
« Reply #11 on: July 09, 2012, 09:21:21 PM »

Thanks for the explanation, Paul. I think I understand, but you didn't say what you meant by "persistence."
You mean the world can randomly generate?
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #12 on: July 09, 2012, 09:24:52 PM »

Thanks for the explanation, Paul. I think I understand, but you didn't say what you meant by "persistence."
You mean the world can randomly generate?

Persistence = storage.  It saves the data so that the next time you run the program it is available.  The old version of the AI tester was a clean slate every time I ran it.

In the real game the towns will be randomly generated but that has nothing to do with persistence.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #13 on: July 09, 2012, 09:35:27 PM »

Now that buildings can understand about their outputs, the next thing will be giving them a list of required inputs.  After that, I can start mapping requirements to resource production and figure out how well the town is operating.

So I see that you have the road layed out in front of you now but I'm just curious, the player will be able to construct objects in the final version. However, how do you plan to allow players to build their own buildings.

 (My thought would be similar to blueprint editor but in the physical world, with predefined objects of specialty, sawmill furnace etc, and hopefully the ai could navigate)

 I see you taking the a method highlighting object properties instead, which would make it easier to autogenerate but in my opinion harder to manually design something unique but recognizable for ai.

This is a simplified version where the buildings are also the entities doing the production.  In the real game, that won't really be true.  A blacksmith could have a forge and anvil out in the middle of the woods if he wanted.  And for an object to be a forge or an anvil the idea is just that it must meet certain physical properties.

In general, if you were trying to create and manage your own town, the plan is that you could do this at a few different levels.

You can already designate subplots of a town.  In the final game, you will be able to "zone" them for certain industry and hire NPCs to work there.  So if you mark a plot as "blacksmith" then an NPC will show up to work there.  If he doesn't have a place to work yet then he might build or buy his tools, house, etc. on the plot you provided.  Or you can prebuild his house for him and let him furnish the tools... or furnish everything for him.  Either way, there will be material costs that ultimately fall back to you somehow.  (Though chances are a blacksmith comes with his own set of tools, at least.)

If you build the house for them then you populate it with furniture or the NPC will try to acquire his own so that at least he has a bed to sleep in, etc.. 

The hope is that the purpose of an object can be determined by its physical properties.  In fact, my biggest worry here is that the NPC would pick the wrong thing... for example, sleeping on the table instead of the bed upstairs.

In the best case, Mythruna will automatically determine the properties of an object.  In the worst case, the creator of the blueprint must indicate which things it thinks the object is suitable for and the game can validate that it meets the requirements.  Most likely it will be some combination of these things so that the AI doesn't get confused and start cooking his food in his forge (though 'how much heat does this product' will be an easy physical property it made for a funny example).

Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #14 on: July 09, 2012, 09:42:24 PM »

Also note: players are sort of super-beings.  We can construct a building in a small fraction of the time that it would take for an NPC.  An NPC will build under more realistic constraints... ie: it takes time to actually do the construction and they can't just carry tons of material on their person.

All of this will contribute to the lag of when the blacksmith can actually start producing.  If you provide him an empty plot then it might be a year in game time before he can start making you stuff.  If you pile up his required materials for him then perhaps it only takes a month in game time.

...or you could just build his house for him in less than a day.

In my dream game, all of this will affect the smith's ultimate relationship with you and the town... and not in entirely positive or negative ways.  For example, if you build everything for him then he will like you a lot but he also won't feel very vested or loyal to the town itself.  Where as if you make him build everything himself then he might really never care who you are but really feel the need to help and protect the town itself.  Assuming those kinds of things ever come up in his goal to action planning.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!