The first inhabitant of every game world should be the player himself. Not because he might have something interesting to do yet, but to do Usability Testing. The most important thing to a game is how the users view it. Games receive little points for being technically sound but magnitudes more for how fun it is.
Know who the first player is? The developer(s) should be the first player. The most effective builders of a product are those who use it themselves.
I’ve started off with some simple types to slowly compose into people (creatures, monsters, NPC, player)
///Wight, human, etc. type Race = { Id : int ///Proper noun Noun : string ///Proper adjective Adjective : string ///User-visible description Description : string } |
///A body with base stats/characteristics. ///Any mutable data is in a higher level. type Body = { Id : int Race : Race ///Normal "bodies" fit in one tile (1,1). Bosses and the largest entities can take up multiple tiles. Size : Morgemil.Math.Vector2i } |
///This is a high level view of an entity. Typically holds any mutable data (can change each game step). type Person = { Id : int Body : Body ///This plus Body.Size constructs the person's hitbox Position : Morgemil.Math.Vector2i } |
This is a bit more info than I need for a basic player moving on the map. I’ve defined four basic actions
///The actions available to an entity. type Actions = | MoveEast | MoveNorth | MoveWest | MoveSouth |
As well as a super simple way to test these actions in my playground project
open Morgemil.Math type Walkabout(dungeon : Morgemil.Map.Chunk, player : Morgemil.Game.Person) = member this.Dungeon = dungeon member this.Player = player member this.Act(act : Morgemil.Game.Actions) = let offset = match act with | Morgemil.Game.MoveEast -> Vector2i(1, 0) | Morgemil.Game.MoveWest -> Vector2i(-1, 0) | Morgemil.Game.MoveNorth -> Vector2i(0, 1) | Morgemil.Game.MoveSouth -> Vector2i(0, -1) Walkabout(dungeon, { Id = player.Id Body = player.Body Position = player.Position + offset }) |