PlayByMail Forums
Game Design - Printable Version

+- PlayByMail Forums (https://forums.playbymail.dev)
+-- Forum: Play-By-Mail Games (https://forums.playbymail.dev/forumdisplay.php?fid=1)
+--- Forum: Games (https://forums.playbymail.dev/forumdisplay.php?fid=4)
+---- Forum: KnightGuild (https://forums.playbymail.dev/forumdisplay.php?fid=48)
+---- Thread: Game Design (/showthread.php?tid=130815)



Game Design - Talisman - 03-01-2022

Since I get a few questions about the design, I thought I would share several of the components -

Core - This is a group of C# programs using Entity Framework and connecting to a SQL Server database.  Core does the setup work for the turns, cycle processing, validation, processing, senior turns, market updates, combat and the emailing of completed turns. 

Maps - This uses an off the shelf free editor - Tiled (https://www.mapeditor.org/). To make this work with our system, we built a C# Windows application (MapSync) that uses the output file from Tiled (in JSON format) and displays it.  You can then save the map into our SQL database.  MapSync allows us to pull the map back from the database, and display it.  You can also change the map Icon set.  We also integrated the map logic into the Core to allow construction projects to update the map in the database as players complete projects.  Next step is to generate the map automatically and update the stored version.

Data Entry - We currently have two methods:
1.  Through the Web site.  We use a WordPress site with a purchased set of tools to allow a fill in the blank form for players to input their turns.  
2.  Through an Excel spreadsheet.  We provide a template you can download from the Web or Discord server.  You create your actions, type them into the Excel spreadsheet (which error checks them) and then you upload the Excel file using the web site.

Reports - are generated through SSRS (a sub-system of SQL Server Database).  I created another C# program that generates the PDF file containing the turn and emails it to the player's email on file through an SMTP service.

Money - is collected through the web site through a PayPal application; but we are looking at other options, such as Stripe.


RE: Game Design - Talisman - 03-04-2022

For Data Entry on the web - WordPress works well. Add to it a few plug-ins:
1. Custom Post Type UI - this lets you create custom post types - when a user saves to your site, it is a "post" and goes into a generic folder called "Posts". By using this tool, you can create new folders such as "My Positions", "My Actions", "My Players", etc. to put posts that the player make through your input pages into different folders.
2. The next three are all for fill in the blank forms -
a) Advanced Custom Fields PRO (the pro version allows repeating fields which is pretty handy). This lets you define fields to hold your data.
b) Advanced Forms PRO (displays collections of Fields defined in (a).
c) Advanced Custom Fields: Custom Database Tables - this lets you store the results from you forms into specific tables in the database
This got me close to what I wanted for data entry, but I added a custom plug-in that I wrote in PHP to handle returning players wanted to edit previously submitted turns. If you are interested we can dive into that.


RE: Game Design - Talisman - 03-13-2022

For Maps - We started with TILED (https://www.mapeditor.org/).  A very good map generator / editor and it is "free".  If you decide to use it, make a donation to them.  If you want a nice, simple 2D map (like KnightGuild), you just need an icon set.  You can create your own icon set or, if you are like me and don't have any artistic ability, you can buy icons from various sources.  I like Unity (assetstore.unity.com) and search for map tiles or icons.  You can buy a set to use with your game

Tiled will save your maps as an image or as a datafile - their format or JSON.  Being a programmer, I wrote a C# program to transfer JSON files to / from my SQL Database.  This lets me use the TILED editor for creating new maps, but allows the game system to update the maps as the players complete projects.


RE: Game Design - Talisman - 03-15-2022

For Reports - We use SSRS - which is the reporting part of SQL Server. We run the latest version of SQL Server 2019 in-house. Reports are created / customized through Visual Studio 2019. KnightGuild reports are elaborate, with multiple sections. Each section is it's own report and all are printed by one master report. When generated, they produce a multi-page PDF file. We use that with SMTP2GO (a bulk emailer) and another program written in C# to create the reports, attach them to email messages and send them. Our process flags each report for printing so the whole thing is automatic.


RE: Game Design - Talisman - 04-18-2022

As we get closer to our "go-live" date; I want to automate the way data moves from the web site to the SQL Server back end. In order to do that, I am going to use the REST API that WordPress makes available. Since I want the code to be in C# and running on my servers, it will have to have permission from the folks who host the site to allow the REST API to work. My goal will be to automate the retrieval of Player turns, special actions and messages (which are all custom post types) and then get new players and new positions.

To test this out, I am going to start with just capturing new Players. On the web, a potential customer has to "Join" the web site - this gives them access to the forums, downloads and access to the menu items that allow them to create an account and/or create new positions. To become a player, they have to "Sign up" on the web site. This creates a KnightGuild account based on the email you used to "Join" the web site. Note that your turns must be submitted from this same email account. Once you have done this, you can then "Add Position". If its the first time you have created a position, be sure to check with folks on Discord or ask questions and get help.

More as this develops


RE: Game Design - Talisman - 06-14-2022

Talk about a lot of wrong information. It took me awhile to work my way through the out-of-the-box REST API that comes with WordPress by default. If you activate the REST API, you need to add a plug-in that forces authentication for access to the REST API. Once you have done that, you need to set up an account / password to use it. Once complete, you should be able to see the difference from a browser. Type in something like - https://<your web site>/wp-json/wp/v2/posts?per_page=100 and you would get back 100 posts in JSON format. Once you turn on authentication - you get back an error. Its an easy way to test to see if your site is protected.

You can also use Postman - www.postman.com which lets you test API calls and find out what they want in order to use them. My backend is all in C# and runs on a completely separate server, most of the examples you will find are for WordPress plugins. Also note that the REST API for WordPress.ORG is different than the one for WordPress.COM.