I just wrote an article about implementing a basic AI in #eco2d.
It features basic hunger needs, #flecs, and other goodies!
https://blog.zakto.pw/articles/ce1856a/eco2d-creature-life-simulation
With 20k NPCs running around, the game runs at an average 12ms tick rate.
#eco2d makes use of distance and action based streaming.
WIP notification manager in #eco2d
With the tooltips done, I think it's time to implement a basic notification feature too!
Small tooltip demo!
The tooltip system is now done! Although it requires some UI improvements, the functionality itself is complete.
Tooltip links are generated at startup by scanning the help text for any terms registered as tooltips already.
Example code:
void tooltip_register_defaults(void) {
// test
tooltip_register( (tooltip) { .name = "ASSET_WOOD", .content = "Used as a building material or fuel for the ASSET_FURNACE." } );
tooltip_register( (tooltip) { .name = "ASSET_FURNACE", .content = "Producer used to smelt ASSET_IRON_ORE into ASSET_IRON_INGOT." } );
tooltip_register( (tooltip) { .name = "ASSET_IRON_ORE", .content = "Natural resource that can be smelted in ASSET_FURNACE." } );
tooltip_register( (tooltip) { .name = "ASSET_IRON_INGOT", .content = "Used as a building material. It is smelted from ASSET_IRON_ORE" } );
}
As a user, you call:
tooltip_show("ASSET_FURNACE", mouse_pos.x+5, mouse_pos.y+5);
And the internals will draw a tooltip with references to other registered help texts in content.
Having played Crusader Kings 3 and Victoria 3 for quite a time, I appreciate these games' multi-level tooltip system. I feel tooltips would be a great addition to eco2d to explain various mechanics or provide valuable information directly when the context requires it.
Thanks to the fantastic wrapper raylib-nuklear made by @[email protected], the Nuklear UI integration is seamless. I can't wait to test it out on some new tools!