{"id":373,"date":"2025-07-07T16:23:40","date_gmt":"2025-07-07T06:23:40","guid":{"rendered":"https:\/\/nonlinearexperience.com\/?p=373"},"modified":"2025-07-07T16:25:02","modified_gmt":"2025-07-07T06:25:02","slug":"data-model","status":"publish","type":"post","link":"https:\/\/nonlinearexperience.com\/index.php\/2025\/07\/07\/data-model\/","title":{"rendered":"Data model"},"content":{"rendered":"<h1 class=\"wp-block-post-title\">Data model<\/h1>\n\n\n<p class=\"wp-block-paragraph\">See also: <a href=\"https:\/\/nonlinearexperience.com\/index.php\/2025\/07\/07\/progression-and-achievement-system\/\" data-type=\"post\" data-id=\"319\">Progression and achievement system<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>track progress for individual players<\/li>\n\n\n\n<li>mini games added over time<\/li>\n\n\n\n<li>progress of the mini games will be tracked for individual players<\/li>\n\n\n\n<li>incorporate the progress and completion of the mini games into the main game, as well as other mini games<\/li>\n\n\n\n<li>an efficient, extensible solution<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Layers<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">OBJECT LAYERS &#8211; export as data<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Exit &#8211;\u00a0<\/li>\n\n\n\n<li>Entrance &#8211;\u00a0<\/li>\n\n\n\n<li>Hole &#8211; BLACK<\/li>\n\n\n\n<li>Transport &#8211;\u00a0<\/li>\n\n\n\n<li>Items &#8211; RED &#8211; this would be what is INSIDE a pot, for example, NOT if there is a pot there\u2026<\/li>\n\n\n\n<li>Sprite Spawn &#8211; PINK &#8211; Sprite ID and name<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">COLLISION (folder) &#8211; export as data<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Collision &#8211;\u00a0<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">GRAPHICS (folder) &#8211; export as data and graphics<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>foreground (folder)<\/li>\n\n\n\n<li>background (folder)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Question &#8211; is it better to generate background\/foreground map at runtime (or at load\/set up time) &#8211; or load a complete graphic? I feel that its better to generate it at load time\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why? potential for saving memory &#8211; can also be changed at run\/game time\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I mean, apart from the graphics, all the other things are being generated at run time\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why not? processor overhead &#8211;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See: Tile Buffer<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Load adjoining<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">each map has a list of surrounding, adjoining map pieces, as well as&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">load map sections, including<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">the loadAdjoining array should start with the first 8 (top left, top middle, top right, middle left, middle right, bottom left, bottom middle, bottom right) slots always there &#8211; even if they are set to &#8216;null&#8217; &#8211; the algorithm uses their position to determine which map joins where<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Examples<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">start &#8211; load the map &#8211; load adjoining (seen in red below)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">move to adjoining &#8211; load adjoining (seen in red below) &#8211; leave already adjoining (seen in orange below) unload others except for adjoining (seen in blue below)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, there will always be 9 map sections at minimum loaded at once.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But what about going into a house &#8211; start in house then what is loaded?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">from within a room you can: go outside &#8211; go to other rooms<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">from outside you can: go to another section of map &#8211; go into a room<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Needs to load all of the &#8216;layers&#8217; of data<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To be honest &#8211; these days, is this kind of thing required? For example, a map like the zelda overworld is 8&#215;8(64) map sections of 64&#215;64(4096) &#8211; 262144 tiles<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Well, if i keep adding to it, it will allow for that and maintain it performance\u2026 ish\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Resources<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>See also: Progression and achievement system Requirements: Layers OBJECT LAYERS &#8211; export as data COLLISION (folder) &#8211; export as data GRAPHICS (folder) &#8211; export as data and graphics Question &#8211; is it better to generate background\/foreground map at runtime (or at load\/set up time) &#8211; or load a complete graphic? I feel that its better [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"wp-custom-template-nlx-the-knowledge-page","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-373","post","type-post","status-publish","format-standard","hentry","category-the-knowledge"],"_links":{"self":[{"href":"https:\/\/nonlinearexperience.com\/index.php\/wp-json\/wp\/v2\/posts\/373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nonlinearexperience.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nonlinearexperience.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nonlinearexperience.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nonlinearexperience.com\/index.php\/wp-json\/wp\/v2\/comments?post=373"}],"version-history":[{"count":2,"href":"https:\/\/nonlinearexperience.com\/index.php\/wp-json\/wp\/v2\/posts\/373\/revisions"}],"predecessor-version":[{"id":376,"href":"https:\/\/nonlinearexperience.com\/index.php\/wp-json\/wp\/v2\/posts\/373\/revisions\/376"}],"wp:attachment":[{"href":"https:\/\/nonlinearexperience.com\/index.php\/wp-json\/wp\/v2\/media?parent=373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nonlinearexperience.com\/index.php\/wp-json\/wp\/v2\/categories?post=373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nonlinearexperience.com\/index.php\/wp-json\/wp\/v2\/tags?post=373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}