PDA

View Full Version : Action System - Database additions - Table/column list



Mirviriam
01-06-2011, 06:53 AM
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

Mirviriam
01-06-2011, 06:55 AM
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

Mirviriam
01-06-2011, 06:55 AM
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

Mirviriam
01-06-2011, 07:07 AM
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.

Mirviriam
01-06-2011, 08:12 AM
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.

Mirviriam
01-06-2011, 08:16 AM
I have another month or two of work on megameknet project, but I can turn out the code for this one relatively easily.

Dyark
01-06-2011, 11:03 AM
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 !

Dyark
01-06-2011, 11:12 AM
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

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 ... :(

Mirviriam
01-07-2011, 10:42 AM
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.

Mirviriam
01-07-2011, 10:46 AM
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 !

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.

Dyark
01-07-2011, 11:25 AM
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.