10.03.2019 - Round 1 results of our "A Love Letter For FreeBASIC" game dev competition have been published. Please be sure to check the results thread: http://games.freebasic.net/forum/index.php?topic=629.0. Don't forget that the competition is continuing with a round 2, lasting till 29th of April, 300 USD first prize. Stay tuned!

Author Topic: Old Game "Design"  (Read 4757 times)

Pritchard

  • Global Moderator
  • Forum Howler
  • *****
  • Posts: 160
    • View Profile
    • Email
Old Game "Design"
« on: May 05, 2012, 09:02:08 PM »
I may start dumping some of the old work I recently recovered from archives.  For anyone who's interested, here's a "design document" I wrote while experimenting with different ways to describe game rules and mechanics.  Anyone care to decrypt exactly what I was describing, here?

Features:

- A mathematical approach to describing the rules of game mechanics

- Entity.Property notation

- Entity[Array size] notation

- Notation for valid values of described object properties

- Notation attempts to answer queries in a pseudo-mathematical way, allowing direct translation to code.

Conclusion:  I never made this game, so I can't say it was very effective...  But I thought I'd share.

Code: [Select]
Edge:

Start.X
(<= 0 =>)
Start.Y
(<= 0 =>)
End.X
(<= 0 =>)
End.Y
(<= 0 =>)

Floor (Edge):

Width
(|End.X - Start.X|)
(> 0)
Height
(= 0)

Wall (Edge):

Width
(|End.X - Start.X|)
(> 0)
Height
(|End.Y - Start.Y|)
(> 0)

Hill:

Rise (Edge)
Start.Y
(= 0)
Fall (Edge)
Start.X
(= Rise.End.X)
Start.Y
(= Rise.End.Y)
End.X
(> Rise.End.X)
End.Y
(= 0)
Peak
X
(= Rise.End.X)
(= Fall.Start.X)
Y
(= Rise.End.Y)
(= Fall.Start.Y)

Surface:

(Assume All Objects are On or Above a 'Surface')
Edge.Length
(> 0)
Edge.Count
(>= 1)
Edge[Edge.Count] (Edge)
(Edge[N].Start.Y = Edge[N].End.Y  = 0)
(Edge.Length = |Edge[N].Start.X - Edge[N].End.X|)
(Edge[N].Start.X = Edge[N-1].End.X)

Jump:

Rise.Speed
(>= 0)
Fall.Speed
(>= 0)
Height
(>= 0 <= Max Height)
Retain.Time
(>= 0 <= Retain.Max Time)

Jump Time:

(QUERYLIST)
What amount of 'Time' passes -ascending and descending- -to and from- 'Jump.Height'?
What is the 'Total Time' of a 'Jump'?

(QUERY)  What amount of 'Time' passes -ascending and descending- -to and from- 'Jump.Height'?
Jump.Rise.Time
(Jump.Height / Jump.Rise.Speed)
Jump.Fall.Time
(Jump.Height / Jump.Fall.Speed)

(QUERY)  What is the 'Total Time' of a 'Jump'?
Jump.Total Time
(Jump.Rise.Time + Jump.Fall.Time + Jump.Retain.Time)

Body (Wall):

Jump (Jump)
(References to 'Jump' should imply a 'Body')

Jump Width on a Surface; Max Jump Width:

(QUERYLIST)
What is the 'Total Width' of a 'Jump'?
When executing 'Jump', what is the 'Local Width' between 'Body' and 'Floor'?
What are the Min & Max Thresholds for a 'Jump' to Clear a 'Floor'?

Surface.Speed
(<= 0 >=)

(QUERY)  What is the 'Total Width' of a 'Jump'?
Jump.Total Width
(Jump.Total Time * Surface Speed)

(QUERY)  When executing 'Jump', what is the 'Local Width' between 'Body' and 'Floor'?
Jump.Floor.Local Width
((Body.End.X - Floor.Start.X) - Jump.Total Width)
Jump.Floor.Local Time
(Jump.Local Width / Surface.Speed)

(QUERY)  What are the Min & Max Thresholds for a 'Jump' to Clear a 'Floor'?
Jump.Floor.Unreachable
(Jump.Floor.Local Width > 0)
Jump.Floor.Unclearable
(Jump.Floor.Local Width <= 0)
(Jump.Floor.Local Width > -(Floor.Length + Body.Width))

Floor Difficulty Thresholds:

(QUERYLIST)
How much non-'Floor' 'Width' and 'Time' exists between 'Jump's?
Adjusting for 'Body', how would the above query be re-calculated?
What measurement would we use to judge the 'Difficulty' of a 'Floor' 'Jump'?

(QUERY)  How much non-'Floor' 'Width' and 'Time' exists between 'Jump's?
Jump.Floor.Empty Width
(Floor[n].End.X - Floor[n+1].Start.X)
Jump.Floor.Empty Time
(Jump.Floor.Free Width * Jump.Floor.Free Time)

(QUERY)  Adjusting for 'Body', how would the above query be re-calculated?
Jump.Floor.Safe Width
(Jump.Floor.Empty Width - (Body.End.X - Floor[n].End.X))
Jump.Floor.Safe Time
(Jump.Floor.Safe Width * Surface.Speed)

(QUERY)  What measurement would we use to judge the 'Difficulty' of a 'Floor' 'Jump'?
Jump.Empty.Difficulty
(>= 0 <= 1)
(1 - ((Jump.Floor.Safe Time - Floor.Timing.Hardest) / (Floor.Timing.Easiest - Floor.Timing.Hardest)))
Jump.Floor.Difficulty
(>= 0 <= 1)
((Floor.Width + Body.Width) / Jump.Total Width)

Clearing Walls; Jump.Height per Jump.Width:

(QUERYLIST)
What is the 'Ratio' between 'Jump.Width' and 'Jump.Height'?
What 'Wall' conditions are always 'Unclearable'?
When executing 'Jump' State n until 'Body.n.X' = 'Wall.n.X', what is the 'Local Height' of a 'Wall'?
What are the Min & Max Thresholds for a 'Jump' to Clear a 'Wall'?

(QUERY)  What is the 'Ratio' between 'Jump.Width' and 'Jump.Height'?
Jump.Rise per Run
(Jump.Rise.Speed / Surface.Speed)
Jump.Fall per Run
(Jump.Fall.Speed / Surface.Speed)
Jump.Run per Rise
(Surface.Speed / Jump.Rise.Speed)
Jump.Run per Fall
(Surface.Speed / Jump.Fall.Speed)

(QUERY)  What 'Wall' conditions are always 'Unclearable'?
Jump.Wall.Too High
(Wall.Height > Jump.Max Height)
Jump.Wall.Too Long
(Wall.Width > (Jump.Total Width - Body.Width))

(QUERY)  When executing 'Jump' State n until 'Body.n.X' = 'Wall.n.X', what is the 'Local Height' of a 'Wall'?
Jump.Wall.Rise.Local Height
(Wall.Height - ((Body.End.X - Wall.Start.X) * Jump.Rise per Run))
Jump.Wall.Retain.Local Height
(Wall.Height - Jump.Height)
Jump.Wall.Fall.Local Height
(Wall.Height - (Jump.Height - ((Body.Start.X - Wall.End.X) * Jump.Fall per Run)))

(QUERY)  What are the Min & Max Thresholds for a 'Jump' to Clear a 'Wall'?
Jump.Wall.Unreachable
(Jump.Wall.Rise.Local Height > 0)
Jump.Wall.Unclearable
(Jump.Wall.Retain.Local Height > 0)
(Jump.Wall.Fall.Local Height > 0)

Wall Difficulty Thresholds:

(QUERYLIST)
What is the minimum 'Width' accumulated during 'Jump.Fall' after clearing a 'Wall'?
What is the minimum 'Empty Width' needed for a 'Wall' 'Jump.Rise' to be 'Safe'?
What measurements would we use to judge the difficulty of a 'Wall' 'Jump'?

(QUERY)  What is the minimum 'Width' accumulated during 'Jump.Fall' after clearing a 'Wall'?
Jump.Wall.Fall.Width
(Jump.Run per Fall * Wall.Height)

(QUERY)  What is the minimum 'Empty Width' needed for a 'Wall' 'Jump.Rise' to be 'Safe'?
Jump.Wall.Empty.Safe Width
(Body.Width + Jump.Wall.Fall.Width + (Wall.Height * Jump.Run per Rise))
Jump.Wall.Empty.Safe Time
(Jump.Wall.Empty.Safe Width / Surface.Speed)

(QUERY)  What measurements would we use to judge the difficulty of a 'Wall' 'Jump'?
Jump.Wall.Difficulty.Empty
(>= 0 <= 1)
(1 - ((Jump.Wall.Safe Time - Wall.Timing.Hardest) / (Wall.Timing.Easiest - Wall.Timing.Hardest)))
Jump.Wall.Difficulty.Width
(>= 0 <= 1)
((Wall.Width + Body.Width) / Jump.Total Width)
Jump.Wall.Difficulty.Height
(>= 0 <= 1)
(Wall.Height / Jump.Max Height)

Clearing Hills; Hill Slope & Jump Slope:

(QUERYLIST)
What is 'Hill.Width'?
What is the 'Ratio' between 'Hill.Height' and 'Hill.Width'?
What 'Hill' conditions are always 'Unclearable'?
What 'Hill' conditions are always 'Clearable'?
When executing 'Jump' State n until 'Body.n.X' = 'Hill.n.X', what is the 'Local Height' of 'Hill'?
What are the Min & Max Thresholds for a 'Jump' to Clear a 'Hill'?

(QUERY)  What is 'Hill.Width'?
Hill.Rise.Width
(Hill.Rise.Start.X >= Hill.Peak.X)
(|Hill.Rise.Start.X - Hill.Peak.X|)
(Hill.Rise.Start.X <  Hill.Peak.X)
(= 1)
Hill.Fall.Width
(Hill.Peak.X >= Hill.Fall.End.X)
(|Hill.Peak.X - Hill.Fall.End.X|)
(Hill.Peak.X <  Hill.Fall.End.X)
(= 1)
Hill.Width
(Hill.Rise.Width + Hill.Fall.Width)

(QUERY)  What is the 'Ratio' between 'Hill.Height' and 'Hill.Width'?
Hill.Rise per Run
(Hill.Peak.Y / Hill.Rise.Width)
Hill.Fall per Run
(Hill.Peak.Y / Hill.Fall.Width)
Hill.Run per Rise
(Hill.Rise.Width / Hill.Peak.Y)
Hill.Run per Fall
(Hill.Fall.Width / Hill.Peak.Y)

(QUERY)  What 'Hill' conditions are always 'Unclearable'?
Jump.Hill.Too High
(Hill.Peak  > Jump.Max Height )
Jump.Hill.Too Long
(Hill.Width > Jump.Total Width)

(QUERY)  What 'Hill' conditions are always 'Clearable'?
Jump.Hill.Rise.Clearable
(Hill.Run per Rise > Jump.Run per Rise)
((Jump.Rise.Time * Jump.Rise.Speed) >= Hill.Peak.Y)
((Jump.Rise.Time * Surface.Speed) + Body.Width >= Hill.Peak.X)
Jump.Hill.Retain.Clearable
(Jump.Height >= Hill.Peak.Y)
((Jump.Retain.Time * Surface.Speed) >= Hill.Width)
Jump.Hill.Fall.Clearable
(Hill.Rise per Run > Jump.Rise per Run)
(Jump.Height >= Hill.Peak.Y)
(Body.Start.X > Hill.Peak.X)

(QUERY)  When executing 'Jump' State n until 'Body.n.X' = 'Hill.n.X', what is the 'Local Height' of 'Hill'?
(Just a side note - The jump state is executed until X axis collision, which is how the height comparison works ;)
Jump.Hill.Rise.Local Height
(Hill.Peak.Y - ((Body.End.X - Hill.Peak.X) * Jump.Rise per Run))
Jump.Hill.Fall.Local Height
(Body.Start.X > Hill.Peak.X)
(Hill.Peak.Y - (Jump.Height - ((Body.Start.X - Hill.Peak.X) * Jump.Fall per Run)))
Jump.Hill.Land.Local Width
(Hill.Peak.X > Hill.Fall.End.X)
((Body.Start.X + (Jump.Height * Jump.Run per Rise)) - Hill.Fall.End.X)

(QUERY)  What are the Min & Max Thresholds for a 'Jump' to Clear a 'Hill'?
Jump.Unreachable
(Jump.Hill.Rise.Local Height > 0)
Jump.Unclearable
(Jump.Hill.Fall.Local Height > 0)
(Jump.Hill.Fall.Local Width  > 0)

Hill Difficulty Levels:

(QUERYLIST)
What is the minimum 'Width' accumulated during 'Jump.Fall' after clearing a 'Hill'?
What is the minimum 'Empty Width' required for a 'Hill' 'Jump.Rise' to be 'Safe'?
What measurements would we use to judge the difficulty of a 'Hill' 'Jump'?

(QUERY)  What is the minimum 'Width' accumulated during 'Jump.Fall' after clearing a 'Hill'?
Jump.Hill.Fall.Safe Width
(Hill.Peak.X <= Hill.Fall.End.X)
(Jump.Run per Fall * Hill.Peak.Y)
(Hill.Peak.X >  Hill.Fall.End.X)
(Hill.Run per Fall >= Jump.Run per Fall)
(0)
(Hill.Run per Fall <  Jump.Run per Fall)
((Hill.Peak.Y * Jump.Run per Fall) - Hill.Fall.Width)
Jump.Hill.Fall.Safe Time
(Jump.Hill.Fall.Safe Width / Surface.Speed)

(QUERY)  What is the minimum 'Empty Width' required for a 'Hill' 'Jump.Rise' to be 'Safe'?
Jump.Hill.Rise.Safe Width
(Hill.Peak.X >= Hill.Rise.Start.X)
(Body.Width + Jump.Hill.Fall.Safe Width + (Hill.Peak.Y * Jump.Run per Rise))
(Hill.Peak.X <  Hill.Rise.Start.X)
(Hill.Rise per Run <= Jump.Rise per Run)
(Jump.Hill.Fall.Safe Width + Body.Width)
(Hill.Rise per Run >  Jump.Rise per Run)
((Jump.Hill.Fall.Safe Width + Body.Width) + ((Hill.Peak.Y * Jump.Run per Rise) - Hill.Rise.Width))
Jump.Hill.Rise.Safe Time
(Jump.Hill.Rise.Safe Time / Surface.Speed)

(QUERY)  What measurements would we use to judge the difficulty of a 'Hill' 'Jump'?
Jump.Hill.Difficulty.Rise
(>= 0 <= 1)
(1 - ((Jump.Hill.Rise.Safe Time - Hill.Rise.Timing.Hardest) / (Hill.Rise.Timing.Easiest - Hill.Rise.Timing.Hardest)))
Jump.Hill.Difficulty.Fall
(>= 0 <= 1)
(1 - ((Jump.Hill.Fall.Safe Time - Hill.Fall.Timing.Hardest) / (Hill.Fall.Timing.Easiest - Hill.Fall.Timing.Hardest)))
Jump.Hill.Difficulty.Peak
(>= 0 <= 1)
(Hill.Peak.Y / Jump.Max Height)
« Last Edit: May 05, 2012, 09:04:52 PM by Pritchard »