Action System - Database additions - Table/column list

To work, the action system requires set of tables to hold how they are to be handled. You can’t hard code this, because in my system actions can be created by the DM’s or players and used in other campaigns & games.

Read Part 2 in this thread for explanation of the fields

TABLE: actionTable
id
name
//These 3 are links to other tables
CostPlanID
TargetTypeID
FlatCostID
//These 2 are how we determine max targets available to whoever does action
Target#Ratio
Target#Determiner
//Required logic flow entry
RequiresAtLocation
//These 4 might not be needed
RequiresHoldingType
RequiresHoldingLevel
RequiresProvinceType
RequiresProvinceLevel
// These 2 need to be a cross link, but i’m too tired as more than one class can cast priest spells or do other actions
RequiredClass
RequiredClassLevel

TABLE: CostPlan
id
name

TABLE: TargetType
id
value

TABLE: Target#Determiner
id
value

TABLE: Ratio
id
quotient
divisor

This is an example of some filled in values in the fields:

CostName
id value
1 flat
2 ratio
3 initialWithRatio
4 perTargetPerDistance

TargetType
id value
1 domain
2 province
3 holding
4 person
5 unit
6 ship //(technically they can be marked as unit too so this might be redundant)

Target#Determiner
id value
1 single
2 characterlvl
3 holdinglvl
4 provincelvl
5 classlvl
6 characterage
7 skillLvl
8 linkedLvl //(source links & trade routes)

ratioTable
id quotient divisor
1 20 1
2 19 2
3 18 3
… … …
21 1 1
22 1 2 // We skip 0 : anything as pointless
23 1 3
… … …
33 1 20 // at this point we put in the non sequenced fractions
34 5 3
35 3 2
36 4 3

I lost summary in a misclick…grr, not going to go into details when it’s obvious the purpose in next section

Page one lists actions & the person to do the actions in drop down
Page two shows all the targets
Page three allows rp bidding to increase success

Ok, so I had envisioned using table to show the flow chart … instead I’m going to just use keywords “goto: some label” like we’re programing in basic. I’ll actually hold off on that one till you guys confirm you’ve done basic too. I’ll just write semi-pseudo code out.

Create a webpage: 1stPage.display.php
Query1: ActionList’s name & id table
Query2: domain table for domain_id(already held in session var) joining with character table’s char_name & char_id (which in my db holds all liutenants and regents)

Show user an html select drop down menu listing ActionList’s Name
Show user an html select drop down menu listing all characters

Submit button is hit, calling 1stPage.commit.php

Check first select actually was set
Check second select actually was set

Query4: All of table ActionList joining CostPlan, TargetType, Target#Determiner, Ratio
Query5 on Target#Determiner query proper table (select statement, ignore details)

Check second var (character) is right class for action
Check is variable T#Determiner_ID greater than 1? (assume yes for now)
Compute: Target#Determiner along with Query5 max number of targets the guy running action can affect

Check Query4’s result for RequiredAtLoc
if no set flag to query6 all targets(based on targetType from query4) in which domain has a holding, ownership of the province or a regent/lieutenant present.
if yes set flag to query6 all targets in province where the regent/lieutenant doing the action is located.

Query6: based on flag load list of all targets in to a multiselect form and display it to users

Submit button is hit, calling 2ndPage.display.php

Display all the targets available in multiselect

Submit button is hit, calling 3rdPage.display.php

Display each target’s name, domain they belong too & a drop down menu counting upto 100 (use a constant so it’s easy to enlarge) so the players can bid regency to increase their chances.

Submit button is hit, calling 3rdPage.commit.php

Check that player can afford the action + bidding of all the extra rp
If yes, create entry in the current domain (listed in session var already) table for pending actions.

To make this work in another person’s database, we’re going to need to have a cross link table listing the id number & the stringname of the table to run the queries against.

Possibly the user/pass/sql server if you don’t use standard inherited password file as done in the wrox & o’reily books.

With that in place, this action system can hold entries for 2nd, 3rd & 4th addition with minimal fuss.

I know I used 2nd/3rd edition names for certain things, but without my visual aids, it’s way too hard to explain this in perfectly generic terms.

Plus I’m really tired & spent past hour clarifying my notes.

I have another month or two of work on megameknet project, but I can turn out the code for this one relatively easily.

In my program, I have gone the opposite route for actions: they do nothing, they are just reminders of changes the GMs have to make to the data. In general when playing PbeM games I have seen that people twist actions soooo much that is hard to enforce them programatically.

It’s true some of them (rule, create holding, move army,…) could be easily data-driven, but even those have problems. For example in the Dawn PbeM Boeruine just moved an army across the Shadow World, it’s pretty hard a data-driven Move Army action is ever going to handle that crazy case :S

Just my 2 cents :slight_smile:

the rp bidding is handle live or per time the user is logged (i am looking at something that can be use live or really small delay)

In your actions, can your regent make an action in a province in which they have no presence ?

PS i just read what you wrote, i will need to read it a few times to make sure I understand it fully. It seems a good idea, have you tried the speed of a process like that (curious). I will write back :rolleyes: it’s too early for me now !

That’s why i use vector maps, it is easy to know what you cross from point a to b and shadow world is just math (and problems).

But you are right with player and imagination it can go really far … :frowning:

In my system actions are just a set of descriptions, they do nothing at all :slight_smile: The GMs are the one that read the player actions and modify the data accordingly. This could be influenced because that’s what GMs do in the PbeM Empire’s Twilight, but I think Birthright has too many exceptions (and actions are too flexible) to be constrained :S

When a player creates a turn, it’s marked GM Approved = false. The GMs get a list of turns that they haven’t approved yet, and when they review the turn they can inform the player if the turn is right (then they mark it at GM Approved = true) or tell the player if there are mistakes (you tried to make something impossible or that needs more discussion).

As far as I have seen in PbeM, in general a turn submission has some basic information (actions) and then a looot of extra data. A player of ET for example has been sending sometimes submissions that are 25 pages long, you just can’t hope to handle that in a DB or with code, it has to be handled by a person :S

And about bidding, it’s GM handled too in my version. The player says how much he will bid in a turn and then the GMs handle the biddings behind the scenes.

Mmm, I explained myself wrong I think… I don’t mean that you can’t have 25 pages of text in a single field, I mean that if a player writes 25 pages for a turn it’s because he is doing a lot of weird things, and it’s very hard any code can be so flexible as to handle all the weird things he is trying to do, so in the end the GMs will have to adjust things manually to account for his actions.

Vicente,

Would you copy your replies & put them in a different topic in the Legacy of Kings forum? Then please delete them from this thread?

This topic is not to debate theory. It is only to change the specifics of a piece of pseudo code.

I welcome all of your input, just not where it will clutter up the technical nature of what we are doing in this specific thread. One of my main concerns is being flexible & I share your worries of making every single player of birthright happy.

Dyark, I had to put the page calls in so it made sense.

As I envision it - this will be a set of functions that can be held in an object. The object will reference the sql database for it’s parameters. What I am saying is that you can use it in a game where the turns only last a minute, a month, a year if you wanted. The part where it says, “commit action” could be live, happens as you want it or it could be stored in a table named Pending_Actions & happened when ever the DM decides.

The way i am programminf it, every action, evolution war will be datafilled into table(s)

I will use the class function for the input ouput and the delay also.
Asking Advice : I did not yet count how many domain can be pc played, but to have a real fun, what should the delay be (3 days, a week, 10 days, 2 weeks) over that it is too ong I think if I get 50+ players.