Announcement

Collapse
No announcement yet.

Feudal System Script Developers: Early Discussion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Feudal System Script Developers: Early Discussion

    Current Developers:
    Uber KruX
    Aeson
    Esoteric

    This is early discussion because, well, I am not exactly sure how the entire feudal system is, and to be honest, I don't think anyone but Farb knows that (or if he even does).

    Farb has given each of the three original developers seperate directories on his website, www.ghengisfarb.com. I would propose we use his webspace for the project, since we all have accounts and he seems willing to allow us to mess around and get it all up and running.

    I would, however, request that we all have access to a shared directory, so that we could work on the same scripts (not at the same time, of course). If we are going to work collectively on this project, we will need to be able to access eachother's files. I would suggest a "feudal" directory be made on the website, and access be given to the developers (ie, www.ghengisfarb.com/feudal).

    Now, down to business.

    We need to enumerate pretty much everything that makes up the $mini-demogame, so that rules can be coded. As stated many times, I do not know everything about the game, and would need to fully understand it before I could design an appropiate system for it.

    The basics are easy. I would first propose that we build the system around a forum (IPB, PHPBB, whatever). We're probably going to want our own forums for each city / guilds / whatever in the near future, so why not just create it on GF's site, and then have our scripts link to the forum's user data etc?

    Tile ownership could easily be transferred to a MySQL database, and could be done in two ways, brute force or careful planning. Brute force would basically have a person enter the values for each tile, and when they changed, an admin would have to update them and type in the new values. I do not like this idea, because I am a man of automation. Simple things like building a mine, changing governments, etc, can impact tiles every round, and people may miss changes or enter data incorrectly.

    I would propose that we hard-code the base values for each terrain, and then have the tile table only store several small values: terrain, roaded, irrigated, mined and city. In this system, an admin would only have to update the status of the improvements on a tile, which could be easily done through a control panel.

    In fact, I believe it would be extremely easy to make a script to ask you for a city name, and then create a graphical representation of the city and it's 20 workable tiles, and allow the admin to easily click buttons to road, mine, or irrigate the tiles to match the in-game tiles. In fact, maybe we could pass this job down to Town Elders, to split the work into small chunks.

    Some sort of tile numbering system would be needed for my plan, but if I'm not mistaken Aeson has already found our coordinates from the minimap. It shouldn't be that hard to devise a system based on that.

    It's late, so I'll leave it like this for now. Fellow developers, feel free to post in this thread with your ideas / suggestions. And Aeson, please inform me of the coordinates of our start

    edit: We would need a forum system where people could join groups, much like poly's "civgroups", sometimes only when invited in. Also, I'd like some of them to have icons, but not all of them (ie, secret guilds do not need icons to broadcast their intentions).
    Last edited by Inverse Icarus; July 11, 2004, 04:57.
    "I've lived too long with pain. I won't know who I am without it. We have to leave this place, I am almost happy here."
    - Ender, from Ender's Game by Orson Scott Card

  • #2
    Actually, we would really only need that shared directory- I am not entirely certain what to do to a whole folder on GF's site- I suppose I could plop a forum in there with some modifications, and we could copy it over to the shared folder and take turns butchering.

    I think that whatever we come up with should involve an easy and definitely automated db manager- If we could create a extension of the cash mod, players can make exchanges and it would be communicated to the 'accounts' database instantly, all we would want to add would be the input and payout modifications- that and the tile tracking...and, er, the aaaaaaaaaaaaaaaa....
    dang, I wish I understood the feudal system a little better- Aeson you wrote a version for the $minigame, share your wisdom. please
    Before Enlightenment: Chop Wood, Carry Water.
    After Enlightenment: Chop Wood, Carry Water.
    I reserve the right to speak gibberish in public, to embarass myself as a Senator, and to generally ignore the Bananis Imperialis; assumed competent. The Decadence that was Rome scoffs, I stand in the Bacchanalian temples laughing.

    Comment


    • #3
      Attached is the structure to the database I had put together. I'll go over some of the details for some of the tables. More if the sun doesn't come out today.. (marine layer looks thick! )

      Basically I went with more of the "careful planning" approach. The tiles held values that were pointers to tile types.

      Code:
      CREATE TABLE feudemo_tile (
        id smallint(5) unsigned NOT NULL auto_increment,
        name varchar(64) NOT NULL default '',
        owner tinyint(3) unsigned NOT NULL default '0',
        x tinyint(3) unsigned NOT NULL default '0',
        y tinyint(3) unsigned NOT NULL default '0',
        type tinyint(3) unsigned NOT NULL default '0',
        resource tinyint(3) unsigned NOT NULL default '0',
        improvements int(10) unsigned NOT NULL default '0',
        escrow tinyint(3) unsigned NOT NULL default '0',
        visible tinyint(3) unsigned NOT NULL default '0',
        UNIQUE KEY id (id)
      id is of course a given for any table. There would be an entry for each tile on the map. I could even work out a script so the file (non-compressed) is uploaded and all tiles are updated automatically if we want. AlanH over at the GOTM is working on getting the compression fast enough to work, so maybe even that would be doable.

      name is for a user defined name for their tile.

      owner is a pointer to the id of the feudemo_player entry for the player. The first player would need to be an admin account.

      x and y are the coordinates for the tile. I've already determined the bic coords for our start, and recommend we use them.

      type is a pointer to the id of the feudemo_tile_types entry for the type of tile.

      resource is a pointer to the id of the feudemo_resource entry for the resource (if any) present on the tile.

      improvements is a bitmask with on/off in position relative to the feudemo_improvement entry for the improvements (if any) present on the tile.

      escrow is a bool (I'm not sure how to represent bools in MySQL so just used a tiny int) used to keep track of whether a tile is up for auction or not. (I'm not a real estate agent, so if escrow isn't the right term I apollogize).

      visible is a bool used to keep track of whether the tile is uncovered or not. This would be for if we go with automation, as the tile details could be hidden (or not even entered at all) until it is actually uncovered.
      Attached Files

      Comment


      • #4
        Code:
        CREATE TABLE feudemo_tile_types (
          id tinyint(3) unsigned NOT NULL auto_increment,
          name varchar(64) NOT NULL default '',
          food tinyint(3) unsigned NOT NULL default '0',
          production tinyint(3) unsigned NOT NULL default '0',
          commerce tinyint(3) unsigned NOT NULL default '0',
          ibonus tinyint(3) unsigned NOT NULL default '0',
          mbonus tinyint(3) unsigned NOT NULL default '0',
          rbonus tinyint(3) unsigned NOT NULL default '0',
          UNIQUE KEY id (id)
        ) TYPE=MyISAM;
        This would just hold bic info for the tile types. I'm not sure if it's best to have the i,m,r (irrigate, mine, road.. should be rr too of course) bonuses represented here or in the fuedemo_improvement table.

        Code:
        CREATE TABLE feudemo_improvements (
          id tinyint(3) unsigned NOT NULL auto_increment,
          name varchar(32) NOT NULL default '',
          UNIQUE KEY id (id)
        ) TYPE=MyISAM;
        Same deal. Thinking about it now, it would be best to have the i,m,r,rr bonuses here.

        Code:
        CREATE TABLE feudemo_map (
          id tinyint(3) unsigned NOT NULL auto_increment,
          name varchar(32) NOT NULL default '',
          tiles int(10) unsigned NOT NULL default '0',
          width smallint(5) unsigned NOT NULL default '0',
          height smallint(5) unsigned NOT NULL default '0',
          UNIQUE KEY id (id)
        ) TYPE=MyISAM;
        This was just for future portability of the code. Map size data from the bic, so you could quickly create all the tiles on the map by choosing a mapsize.

        Code:
        CREATE TABLE feudemo_player (
          id tinyint(3) unsigned NOT NULL auto_increment,
          name varchar(32) NOT NULL default '',
          password varchar(32) NOT NULL default '',
          email varchar(64) NOT NULL default '',
          title tinyint(3) unsigned NOT NULL default '0',
          UNIQUE KEY id (id)
        ) TYPE=MyISAM;
        I was handling login and registration through the player table. We'd be doing that through the forum, so could get rid of password and email.

        Code:
        CREATE TABLE feudemo_stock (
          id tinyint(3) unsigned NOT NULL auto_increment,
          name varchar(32) NOT NULL default '',
          UNIQUE KEY id (id)
        ) TYPE=MyISAM;
        Should be renamed feudemo_stock_types as that's what I was using it for. Just would hold the values like Food, Commerce, Production, along with special types like Gems, Coconuts, ect. Probably should store the bonus to F/C/P for special types here too.

        Code:
        CREATE TABLE feudemo_stockpile (
          id tinyint(3) unsigned NOT NULL auto_increment,
          food smallint(5) unsigned NOT NULL default '0',
          production smallint(5) unsigned NOT NULL default '0',
          commerce smallint(5) unsigned NOT NULL default '0',
          labor smallint(5) unsigned NOT NULL default '0',
          tobacco smallint(5) unsigned NOT NULL default '0',
          fruit smallint(5) unsigned NOT NULL default '0',
          sugar smallint(5) unsigned NOT NULL default '0',
          grain smallint(5) unsigned NOT NULL default '0',
          beef smallint(5) unsigned NOT NULL default '0',
          fish smallint(5) unsigned NOT NULL default '0',
          venison smallint(5) unsigned NOT NULL default '0',
          whale smallint(5) unsigned NOT NULL default '0',
          iron smallint(5) unsigned NOT NULL default '0',
          coal smallint(5) unsigned NOT NULL default '0',
          crude_oil smallint(5) unsigned NOT NULL default '0',
          aluminum smallint(5) unsigned NOT NULL default '0',
          uranium smallint(5) unsigned NOT NULL default '0',
          horses smallint(5) unsigned NOT NULL default '0',
          saltpeter smallint(5) unsigned NOT NULL default '0',
          petroleum smallint(5) unsigned NOT NULL default '0',
          fuel_coal smallint(5) unsigned NOT NULL default '0',
          rubber smallint(5) unsigned NOT NULL default '0',
          fuel_cell_uranium smallint(5) unsigned NOT NULL default '0',
          dye smallint(5) unsigned NOT NULL default '0',
          incense smallint(5) unsigned NOT NULL default '0',
          spice smallint(5) unsigned NOT NULL default '0',
          ivory smallint(5) unsigned NOT NULL default '0',
          gems smallint(5) unsigned NOT NULL default '0',
          gold smallint(5) unsigned NOT NULL default '0',
          wine smallint(5) unsigned NOT NULL default '0',
          rum smallint(5) unsigned NOT NULL default '0',
          beer smallint(5) unsigned NOT NULL default '0',
          ale smallint(5) unsigned NOT NULL default '0',
          flour smallint(5) unsigned NOT NULL default '0',
          snacks smallint(5) unsigned NOT NULL default '0',
          pastries smallint(5) unsigned NOT NULL default '0',
          paper smallint(5) unsigned NOT NULL default '0',
          books smallint(5) unsigned NOT NULL default '0',
          pamphlets smallint(5) unsigned NOT NULL default '0',
          UNIQUE KEY id (id)
        ) TYPE=MyISAM;
        This would be a 'warehouse' for the player where they could store their stocks. Needs a size defined too, either here or in feudemo_player. This is one part I'm not enthusiastic about at all! I know there has to be a better way than this massive table.

        Comment


        • #5
          Code:
          CREATE TABLE feudemo_unit (
            id smallint(5) unsigned NOT NULL auto_increment,
            tile smallint(5) unsigned NOT NULL default '0',
            owner double NOT NULL default '0',
            type smallint(5) unsigned NOT NULL default '0',
            name varchar(64) NOT NULL default '',
            hp tinyint(3) unsigned NOT NULL default '0',
            escrow tinyint(3) unsigned NOT NULL default '0',
            alive tinyint(3) unsigned NOT NULL default '1',
            UNIQUE KEY id (id)
          ) TYPE=MyISAM;
          Pretty much just like the tiles. References feudemo_unit_types for all the bic info.

          Code:
          CREATE TABLE feudemo_unit_types (
            id tinyint(3) unsigned NOT NULL auto_increment,
            name varchar(32) NOT NULL default '',
            a tinyint(3) unsigned NOT NULL default '0',
            d tinyint(3) unsigned NOT NULL default '0',
            m tinyint(3) unsigned NOT NULL default '0',
            UNIQUE KEY id (id)
          ) TYPE=MyISAM;
          bic info for units.

          Code:
          CREATE TABLE feudemo_auction (
            id tinyint(3) unsigned NOT NULL auto_increment,
            seller tinyint(3) unsigned NOT NULL default '0',
            title varchar(128) NOT NULL default '',
            item_type set('Tile','Unit','Building') NOT NULL default '',
            item_id smallint(5) unsigned NOT NULL default '0',
            bidding_opens date NOT NULL default '0000-00-00',
            bidding_closes date NOT NULL default '0000-00-00',
            minimum_bid smallint(5) unsigned NOT NULL default '0',
            current_bid smallint(5) unsigned NOT NULL default '0',
            UNIQUE KEY id (id)
          ) TYPE=MyISAM;
          This was to hold the auction data. Pretty straightforward I think.

          Code:
          CREATE TABLE feudemo_bid (
            id smallint(5) unsigned NOT NULL auto_increment,
            player tinyint(3) unsigned NOT NULL default '0',
            amount smallint(5) unsigned NOT NULL default '0',
            auction smallint(5) unsigned NOT NULL default '0',
            UNIQUE KEY id (id)
          ) TYPE=MyISAM;
          These would hold all the bids made by any player on any auction. References the id of feudemo_auction for auction and the id of feudemo_player for player.

          Code:
          CREATE TABLE feudemo_building (
            id smallint(5) unsigned NOT NULL auto_increment,
            tile smallint(5) unsigned NOT NULL default '0',
            owner tinyint(3) unsigned NOT NULL default '0',
            type tinyint(3) unsigned NOT NULL default '0',
            specialty tinyint(3) unsigned NOT NULL default '0',
            name varchar(64) NOT NULL default '',
            escrow tinyint(3) unsigned NOT NULL default '0',
            UNIQUE KEY id (id)
          ) TYPE=MyISAM;
          This references feudemo_business for the type of business. Should be named feudemo_business and feudemo_business_types to be consistant.

          Code:
          CREATE TABLE feudemo_business (
            id tinyint(3) unsigned NOT NULL auto_increment,
            name varchar(64) NOT NULL default '',
            requirements int(11) NOT NULL default '0',
            cost tinyint(3) unsigned NOT NULL default '0',
            upgrade tinyint(3) unsigned NOT NULL default '0',
            upgrade_cost tinyint(3) unsigned NOT NULL default '0',
            labor_required tinyint(3) unsigned NOT NULL default '0',
            labor_max tinyint(3) unsigned NOT NULL default '0',
            consumed_stock tinyint(3) unsigned NOT NULL default '0',
            consumed_rate tinyint(3) unsigned NOT NULL default '0',
            output_stock tinyint(3) unsigned NOT NULL default '0',
            output_rate tinyint(3) unsigned NOT NULL default '0',
            bonus_stock tinyint(3) unsigned NOT NULL default '0',
            bonus_rate tinyint(3) unsigned NOT NULL default '0',
            UNIQUE KEY id (id)
          ) TYPE=MyISAM;
          Holds all the "bic" data for the business types.

          Code:
          CREATE TABLE feudemo_title (
            id tinyint(3) unsigned NOT NULL auto_increment,
            name varchar(32) NOT NULL default '',
            tilerequirement tinyint(3) unsigned NOT NULL default '0',
            unitrequirement tinyint(3) unsigned NOT NULL default '0',
            connectionrequirement tinyint(3) unsigned NOT NULL default '0',
            titlesrequirement tinyint(3) unsigned NOT NULL default '0',
            cost smallint(5) unsigned NOT NULL default '0',
            bonus tinyint(3) unsigned NOT NULL default '0',
            commandleader tinyint(3) unsigned NOT NULL default '0',
            UNIQUE KEY id (id)
          ) TYPE=MyISAM;
          Holds the "bic" data for titles as described.

          Comment


          • #6
            A brief description of the scripts contained in the uploaded file:

            admin_business.php - Create new business types. Fills in the feudemo_business table.
            admin_map.php - Create a new map (and all the tiles therein). Enter/Edit tile data.
            admin_unit.php - Create new units. Enter/Edit unit details.

            /auction/index.php - Create new auction for tiles or units the player $_SESSION[id] owns. View/Bid on auctions other players have created. Date references haven't been made yet, so the auctions never 'open' or 'close'.

            /login/index.php and /register/index.php - very simple scripts to do just that. We won't need these I guess... but if you want to point out all my security vulnerabilities I could use the input.

            /include/database.php - holds the connection stuff so the database, name, password is centralized. Should be using classes for all this stuff but I work best if I get the basic functionality created first, then organize it properly later.

            /include/date.php - just barely started in on this. same deal.

            /include/encrypt.php - basic encryption I was using for passwords.

            /include/html_header.php and /include/html_footer.php - web page formatting of course. Nothing really done here except stealing a bit of GF's website.

            /include/session.php - the $_SESSION stuff. I didn't know if anything else would be needed (first time using sessions), or if cookies would be desirable/necessary... so just separated it out to allow easy updating later if it turned out I was doing everything backasswords.
            Attached Files

            Comment


            • #7
              Stuff that comes to mind as needed:

              feudemo_city - holds population, income splits (F/P/C) for the session, road connection status, ect.

              _government and _technology. Somewhere to hold data about our tech level, government level, ect. As that will affect tile production, resources viewable, market connections, businesses available, ect.

              Admin pages to start and end a trading session, create city polls, fight inter-civ 'battles' or player tournaments of some sort.

              Comment


              • #8

                Comment


                • #9


                  I have no idea as to what that means, but thanks, Aeson.
                  Join a Democracy Game today!
                  | APO: Civ4 - Civ4 Multi-Team - Civ4 Warlords Multi-Team - SMAC | CFC: Civ4 DG2 - Civ4 Multi-Team - Civ3 Multi-Team 2 | Civ3 ISDG - Civ4 ISDG |

                  Comment


                  • #10
                    Looks good to me, I can get into it later this week more thoroughly, but it seems you have done a lot of the thinking for us already. I would figure we could leave out the password and login for now, and just try for functionality.
                    Before Enlightenment: Chop Wood, Carry Water.
                    After Enlightenment: Chop Wood, Carry Water.
                    I reserve the right to speak gibberish in public, to embarass myself as a Senator, and to generally ignore the Bananis Imperialis; assumed competent. The Decadence that was Rome scoffs, I stand in the Bacchanalian temples laughing.

                    Comment


                    • #11
                      If it's going to be built into a forum system, we can just use that for login purposes. If not, the registration/login I have already set up works fine, and is easy to work with.

                      Comment


                      • #12
                        Would any of you Script Developers be willing to help make the Apolyton University a website? It would be PHP run.

                        Comment


                        • #13
                          Would any of you Script Developers be willing to help make the Apolyton University a website? It would be PHP run.
                          What do you want it to be able to do?
                          Sent by Him,
                          Prince TORARADICAL of The MAELRI

                          Creator and High Administrator of Noitazilivic--Home of the first cIV DGame, the first Warlords DGame, and the first BTS DGame

                          Comment


                          • #14
                            I hadn't thought about forums. My new host gives me unmetered bandwidth as long as I obey specific rules (such as no mass distribution of software, etc.). If we have someone willing to set up and run the forums I see no problem with it.

                            Can anyone recommend some websites with good php/mysql tutorials/lessons?
                            Last edited by GhengisFarbâ„¢; July 13, 2004, 09:59.

                            Comment


                            • #15
                              The PHP website itself has very good documentation for any function you could ever need, and has a very extensive library you can search online.

                              I don't know any tutorial sites offhand, but MZ mentioned a few @ MZO a while back.

                              Also, I'd love to set up / help run the forums. I really think all three of our FTP accounts should go to the same directory though (/feudal/).

                              Then, I'd set up www.ghengisfarb.com/feudal/forums/, and we'd get crackin'.
                              "I've lived too long with pain. I won't know who I am without it. We have to leave this place, I am almost happy here."
                              - Ender, from Ender's Game by Orson Scott Card

                              Comment

                              Working...
                              X