{"id":229,"date":"2021-01-23T11:44:31","date_gmt":"2021-01-23T16:44:31","guid":{"rendered":"https:\/\/devlog.oakcityit.net\/?p=229"},"modified":"2021-01-23T11:44:31","modified_gmt":"2021-01-23T16:44:31","slug":"the-union-of-states","status":"publish","type":"post","link":"https:\/\/devlog.oakcityit.net\/the-union-of-states\/","title":{"rendered":"The Union of States"},"content":{"rendered":"\n

In programming, especially in game dev, states are an important concept to manage what’s going on at any given time and what to do next. So we need a finite state machine or ‘FSM’ to manage such things. Basically the state is a data object that can only ever have one value from a finite list of values.<\/p>\n\n\n\n

Following the excellent tutorial from Aleksandr Hovhannisyan<\/a> I’ve made a simple FSM to model a light with three luminosity intensities.<\/p>\n\n\n\n

\"\"
A model of the Light’s logic. Made using draw.io plugin on my nextcloud server. If you want help setting up a Nextcloud server of your own for personal or enterprise use, contact me at Oak City IT<\/a><\/figcaption><\/figure>\n\n\n\n
\"\"<\/figure>\n\n\n\n

Next steps will be to adapt this to a game, and in particular the Graveyard Shift game I’m working on right now. Here’s a preview of the model that will be setup in the code:<\/p>\n\n\n\n

\"\"<\/figure>\n","protected":false},"excerpt":{"rendered":"

In programming, especially in game dev, states are an important concept to manage what’s going on at any given time and what to do next. So we need a finite state machine or ‘FSM’ to manage such things. Basically the state is a data object that can only ever have one value from a finite… Read More »The Union of States<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":233,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"left","neve_meta_author_avatar":"on","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","_ti_tpc_template_sync":false,"_ti_tpc_template_id":""},"categories":[17],"tags":[50,49,36],"_links":{"self":[{"href":"https:\/\/devlog.oakcityit.net\/wp-json\/wp\/v2\/posts\/229"}],"collection":[{"href":"https:\/\/devlog.oakcityit.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devlog.oakcityit.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devlog.oakcityit.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devlog.oakcityit.net\/wp-json\/wp\/v2\/comments?post=229"}],"version-history":[{"count":0,"href":"https:\/\/devlog.oakcityit.net\/wp-json\/wp\/v2\/posts\/229\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devlog.oakcityit.net\/wp-json\/wp\/v2\/media\/233"}],"wp:attachment":[{"href":"https:\/\/devlog.oakcityit.net\/wp-json\/wp\/v2\/media?parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devlog.oakcityit.net\/wp-json\/wp\/v2\/categories?post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devlog.oakcityit.net\/wp-json\/wp\/v2\/tags?post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}