Mythruna

Player's Corner => Gallery => Topic started by: pspeed on July 09, 2012, 12:51:30 AM



Title: More Global Resource Dependency stuff...
Post by: pspeed 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. 
(http://i.imgur.com/dotyp.png)

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. :)

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.


Title: Re: More Global Resource Dependency stuff...
Post by: FutureB on July 09, 2012, 03:40:12 AM
it is looking better and better paul :] keep working on your amazing ai


Title: Re: More Global Resource Dependency stuff...
Post by: Teknonick 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)


Title: Re: More Global Resource Dependency stuff...
Post by: BenKenobiWan on July 09, 2012, 06:56:56 AM
The Mythruna entity system gives you automatic persistence? What does that mean?


Title: Re: More Global Resource Dependency stuff...
Post by: pspeed 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.


Title: Re: More Global Resource Dependency stuff...
Post by: Ghelmaron 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  ;)


Title: Re: More Global Resource Dependency stuff...
Post by: pspeed 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  ;)

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.


Title: Re: More Global Resource Dependency stuff...
Post by: Teknonick 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


Title: Re: More Global Resource Dependency stuff...
Post by: BenKenobiWan 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.


Title: Re: More Global Resource Dependency stuff...
Post by: Teknonick 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


Title: Re: More Global Resource Dependency stuff...
Post by: ahmadsal 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.


Title: Re: More Global Resource Dependency stuff...
Post by: BenKenobiWan 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?


Title: Re: More Global Resource Dependency stuff...
Post by: pspeed 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.


Title: Re: More Global Resource Dependency stuff...
Post by: pspeed 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).



Title: Re: More Global Resource Dependency stuff...
Post by: pspeed 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.


Title: Re: More Global Resource Dependency stuff...
Post by: ahmadsal on July 09, 2012, 09:54:39 PM
hehe, i see it now. So it won't be the building but it will be the properties associated with an object that will define its role. The building itself would probably house a set of objects and the living quarters etc. It is just the need of the worker (blacksmith etc) that will need his tools (furnace etc) and will need his food, bed, etc... which will entirely decide what buildings and objects are needed.

In short, it is that you don't need the physical blacksmith workplace, but instead a tool and the ai's desire to work (for production) which will enable him to use the tools.


Title: Re: More Global Resource Dependency stuff...
Post by: Moonkey on July 09, 2012, 10:21:33 PM
I'm envious for the donators. I like watching what people would do in a town. So, to me, It's a game itself. You need to put a disaster button to set fire to something :) and script it into the NPC's to panic/do something to stop it. My brother got a game/engine called space engine. It's a 3D map of the whole universe, that you can explore. High detailed. Heck, It's so detailed it's 3D movie quality. My brother has a few breathtaking screen shots. I was imagining a space game being made out of it. Reminds me of Pioneer. (Space game) Best part is: It's only half a gig. As a 13(14) year old, space over-excites me.


Title: Re: More Global Resource Dependency stuff...
Post by: pspeed on July 09, 2012, 10:32:09 PM
hehe, i see it now. So it won't be the building but it will be the properties associated with an object that will define its role. The building itself would probably house a set of objects and the living quarters etc. It is just the need of the worker (blacksmith etc) that will need his tools (furnace etc) and will need his food, bed, etc... which will entirely decide what buildings and objects are needed.

In short, it is that you don't need the physical blacksmith workplace, but instead a tool and the ai's desire to work (for production) which will enable him to use the tools.

Yep.  And if you (or he) provide shelter for his workplace then he will be able to work in any weather.


Title: Re: More Global Resource Dependency stuff...
Post by: pspeed on July 09, 2012, 10:38:58 PM
I'm envious for the donators. I like watching what people would do in a town. So, to me, It's a game itself. You need to put a disaster button to set fire to something :) and script it into the NPC's to panic/do something to stop it. My brother got a game/engine called space engine. It's a 3D map of the whole universe, that you can explore. High detailed. Heck, It's so detailed it's 3D movie quality. My brother has a few breathtaking screen shots. I was imagining a space game being made out of it. Reminds me of Pioneer. (Space game) Best part is: It's only half a gig. As a 13 year old, space over-excites me.

True story (thought I may have already told it): I was laying the groundwork for working on a space game when I got inspired to start Mythruna.  As research for how to make modular ship interiors, I even took someone's hi-res artistic renderings of the interior of the NX-01 (from the series Enterprise) and pieced together a whole deck out of them.  I ended up turning it into a huge poster for my son but here is the reduced version:
(http://i.imgur.com/kG23E.jpg)

Piecing that together and labeling it was an obsession for a week or so.  It was only one or two months later that I started on Mythruna.


Title: Re: More Global Resource Dependency stuff...
Post by: pspeed on July 12, 2012, 12:05:10 AM
Made some more progress but I'm tucking this update away in here just for the cool people. :)

Below we start to see the town get knowledgeable about the resources it needs to fit its production plan.  I'm still mapping how work/labor works for a citizen (really just how it gets allocated to them) so that comes up as the biggest need in the "planned production" table.

That and food.  I still need to add farms and stuff.  Also, I have some ideas I need to run to ground on "natural resources"... ie: things that produce without requiring input... and storage.  The two are kind of related actually.
 
(http://i.imgur.com/en08j.png)


Title: Re: More Global Resource Dependency stuff...
Post by: Moonkey on July 12, 2012, 02:03:19 AM
Amazing! How much CPU does this program take up? Because I was thinking of having this pop-up in-game for towns as a manager for towns. AI towns un-controlled by you are managed automatically. But when you make a town, I would like to see something like:

[Town list]------
1.Lebesar-[Size:Village]-[Condition:Happy]
2.Obarlin-[Size:Town]-[Condition:Content]
3.Ukarer-[Size:Kingdom]-[Condition:Un-happy(At War)]
---------------
And when you click on a village, a manager pops up exactly like yours only a top down view of the village,etc. Which you can scroll around with.

--[Village of Lebesar]----
————    ¦   ¦    —––——
|House |  |   |   |   Inn   | [Villagers]
|———–|  |   |   |           | |John
              |   |   |———––|  |etc..
Etc--

Basically a City manager. Like Civilization! (←Game)

:) Great work so far


Title: Re: More Global Resource Dependency stuff...
Post by: BigredRm on July 12, 2012, 05:33:09 AM
It really is awesome following your creation. You've got me checking the forum 4-5 times a day to check for new posts.


Title: Re: More Global Resource Dependency stuff...
Post by: pspeed on July 12, 2012, 08:51:44 AM
It really is awesome following your creation. You've got me checking the forum 4-5 times a day to check for new posts.

Thanks!  That's great to know. :)


Title: Re: More Global Resource Dependency stuff...
Post by: pspeed on July 12, 2012, 08:59:05 AM
Amazing! How much CPU does this program take up? Because I was thinking of having this pop-up in-game for towns as a manager for towns. AI towns un-controlled by you are managed automatically. But when you make a town, I would like to see something like:

[Town list]------
1.Lebesar-[Size:Village]-[Condition:Happy]
2.Obarlin-[Size:Town]-[Condition:Content]
3.Ukarer-[Size:Kingdom]-[Condition:Un-happy(At War)]
---------------
And when you click on a village, a manager pops up exactly like yours only a top down view of the village,etc. Which you can scroll around with.

--[Village of Lebesar]----
————    ¦   ¦    —––——
|House |  |   |   |   Inn   | [Villagers]
|———–|  |   |   |           | |John
              |   |   |———––|  |etc..
Etc--

Basically a City manager. Like Civilization! (←Game)

:) Great work so far

This doesn't take any CPU because there is no processing when the user isn't doing anything.

City management in game will be different, though.  The property notebook will have a map but most of your interaction with the city will be through people, I think.  More opportunity for story and random adventure that way.

Telling story to your friends version A:
"And then I clicked on the blacksmith square and clicked that 'make more swords' button."

Or version B:
"I was heading to the blacksmith to talk about production but then I saw that a new merchant came to town selling swords.  He has a good deal from some town to the east so I told the blacksmith to make shields and I'll make sure to setup a trade agreement with that town.  On the way back, we saw some wolves patrolling the outer streets so I'll have to see about checking the forests outside of town..."

Second version seems more interesting to me. ;)

There will be some central management but it will be at the administrative level just like a real town.


Title: Re: More Global Resource Dependency stuff...
Post by: Moonkey on July 12, 2012, 03:12:45 PM
Ah I see, you want to manage the town with a more direct approach. Instead of magically telling the blacksmith to make swords using a button, you walk up and talk to him. He could be having problems making them, or he couldn't. Also: My new laptop runs Mythruna greatly! But I'm getting Red Memory at 60-70%


Title: Re: More Global Resource Dependency stuff...
Post by: pspeed on July 12, 2012, 03:28:29 PM
Ah I see, you want to manage the town with a more direct approach. Instead of magically telling the blacksmith to make swords using a button, you walk up and talk to him. He could be having problems making them, or he couldn't. Also: My new laptop runs Mythruna greatly! But I'm getting Red Memory at 60-70%

If it's a 64 bit laptop then that might be normal.  Run /mem and if the max memory is anywhere close to 512 meg then you are fine.  If it's close to 256 meg or something then you could have problems.


Title: Re: More Global Resource Dependency stuff...
Post by: Moonkey on July 12, 2012, 08:24:00 PM
Yea It's 64 bit :).