0% found this document useful (0 votes)
17 views18 pages

Analysis

Uploaded by

omm34078
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views18 pages

Analysis

Uploaded by

omm34078
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 18

Planimals

Analysis
Introduction
Understanding ecological concepts, like the food chain, needs more than just listening to lectures
or reading from textbooks. It requires getting hands-on and seeing these ideas in action.
Traditional ways of teaching, which often lean on students passively taking in information, might
not cut it for everyone, especially for those of us who get things better when we can see or
interact with what we’re learning about. If you’re someone who finds it easier to grasp stuff when
it’s visual or when you can get involved, sticking to the old-school approach can make wrapping
your head around complex topics like the food chain a real challenge.
As we are diving deeper into how we learn and how different our learning styles can be, there is a
growing call for teaching that taps into more than just reading and listening. The idea is to make
learning more about doing and seeing, which can be a game-changer for getting to grips with
tricky subjects. This is where something like educational video games could really make a
difference. They are not just more engaging, they could actually help us understand better by
putting us in the driver’s seat and letting us explore these concepts in a more interactive setting.
In this part of my work, I’m going to take a closer look at how stepping away from traditional
teaching and bringing in more interactive tools, like video games, could help us get a better
handle on ecology and the food chain. We’ll see how learning by doing or through games can
make complex ideas easier to understand and remember, and why this might be especially true
for subjects like biology that cover how living things interact with each other and their
environments.

My Approach to Solving the Problem


To combine education and interactivity, I propose the development of a card-based game aimed
to enhance students’ understanding of the food chain concept. This game will inherit some
traditional educational methods and add the interactive, experiential learning styles that are
especially beneficial for visual and hands-on learners.
Through gameplay, players will learn how different organisms depend on each other for survival,
gaining insights into predator-prey dynamics, and the importance of producers within
ecosystems. Players will need to think critically about how to build their food chains. This
strategic element encourages deeper thinking about how ecosystems function. By creating the
interactive nature of the game, students will be more motivated to engage with the content,
making the learning experience both enjoyable and memorable.

Background research
In exploring potential solutions to the problem I am trying to solve and to find inspirations for
my project, I came across various existing games that iherit some elements of animal interactions
and ecosystems.
Hearthstone
..is a game developed by Blizzard Entertainment, where players step into the shoes of heroes,
armed with a deck of 30 cards alongside unique game mechanics, to outwit and defeat their
opponent’s hero.

Hearthstone Gameplay
The game starts with each participant selecting a hero equipped with a singular hero power,
operational once per turn ("Hero Power" in Figure 1). Gameplay revolves around turns where
players draw cards, accumulate mana, and strategically deploy cards to summon minions, enact
spells, or wield weapons against the opponent’s hero. The objective is to deplete the opponent
hero’s health to zero through a combination of minion attacks, spell strikes, or weapon
onslaughts. Players are tasked with mastering the battlefield, judiciously managing resources,
and tactically outmaneuvering their opponent to inflict damage while safeguarding their own
hero.
Every turn, players get one more mana crystal, letting them play stronger cards as the game goes
on. Minions can attack other minions or the enemy hero, and spells can do a bunch of things like
deal damage, make your team stronger, or control the game. Players also have to think about
their hero’s special power and how it can change the game.
Moreover, Hearthstone introduces the concept of classes, suggesting an advantage in
constructing a deck centered around a single class to bolster card effectiveness and enhance deck
synergy. For instance, synergizing Murloc cards can escalate their offensive capabilities—a
parallel to real-world animal behaviors such as herding in deer or the social structure in lion
prides, which inherently provide safety against predators.
The phenomenon of collective defense and hunting efficiency among animals reminds the class
synergy in Hearthstone. Predators, when cooperating together, can overcome larger prey or
deter threats more effectively than solitary individuals. This alignment between Hearthstone’s
class mechanics and the natural world’s symbiotic relationships provides a foundational concept
I aim to add into my game. It illustrates the survival benefits of social structures and cooperation,
both in the virtual and natural environments.
So, the idea of classes in Hearthstone and animals herding in real life are tightly related concepts,
which I can use in my game to explain how the herding works and how it helps animals to
survive.
Hearthstone, although a popular and enjoyable game, may not be the most suitable option for
teaching about the food chain due to several factors. Firstly, the game is set in a fantasy universe
with magical creatures and spells, rather than in the real world where ecological concepts like
the food chain operate. This fantasy setting could potentially create a disconnect for players
trying to understand real-world ecological principles. Additionally, Hearthstone’s primary focus
is on strategy and entertainment rather than educational content. As a result, it may not provide
the depth of understanding or direct relevance to ecological concepts needed for effective
learning about the food chain.
Sacrifice Must Be Made
What inspired me to create a card-based game is a roguelike deck-building game released in
2021 called “Sacrifice Must Be Made”, which, as it finds out, is also a prototype for “Inscryption”.

Sacrifice Must Be Made Gameplay


One of special things about “Sacrifice Must Be Made” is its dark and mercy atmosphere, but also
its mechanics: how you take the cards from the deck, how you build the deck, and how to remain
the balance between you and your opponent. What has made it special for me is that mechanics
are easy to understand, as you use your knowledge about the food chain to build the deck. Even
the title of the game says everything about itself. The round starts on a 2x4. You and your
opponent have a 4 cells row each. The one that is closer to you is used for building your deck and
the second row is for your opponent.
Squirrel(a) and stoat(b) cards
The game has three rounds. At the start of each round your hand has four cards: squirrel, cat and
two stoats. Each card has its attack and defence value. But some cards also have the sacrifice cost,
so to place a stoat, for example, you have to place the squirrel (Figure 3a) first and then place the
stoat(Figure 3b) card onto it and it will automatically sacrifice the squirrel to make stoat an
active card. The sacrifice points may vary depending on how powerful the card is: stoats have 1
sacrifice point and 1|3 attacking and defencing points respectively, whereas the wolf has 2
sacrifice points and stats of 3|3. This mechanics helps to maintain the balance in the game which
is the main point of any card-based game.
The fighting mechanics are quite like Hearthstone’s one, but instead of choosing what card to
attack or even not attacking at all, in SMBM your card will always attack the card in front of it,
which is simple but also smart as it prevents the player from attacking the opponent’s card,
which was going to deal the damage to the player.
Another specialty in this game is how health points are implemented. With card’s defence value
everything is obvious: Attack with the damage of three, an attacked card loses three HPs. But
player also has its health value.
In earlier mentioned Hearthstone the player(hero) has its own health points. As HP comes to
zero the hero dies, and the player loses. In the SMBM, the health bar is represented by the scales.
Each time the player gets a specific amount of damage, which is achieved by not placing the card
in front of the opponent’s card, this amount of damage equals to the number of heavy weights
added to your weight after the attack. When either your cup of the scales or the opponent’s
touches the table, you or the opponent lose.
Sacrifice Must Be Made is one of the closest solutions to the problem I am trying to solve, but it is
still not the ideal tool for teaching about the food chain in ecosystems. One of the reasons is its
departure from ecological realism. In the game, animals exhibit behaviours and abilities that are
not grounded in real-world ecology, such as immortality and supernatural powers. This can lead
to misconceptions or misunderstandings about how real ecosystems function.
Furthermore, the simplified representation of the food chain in the game may not accurately
reflect the complexities of ecological relationships. In nature, food chains are intricate networks
of interactions among various species, influenced by factors such as habitat, competition, and
predation. SMBM simplifies this complexity into a linear progression of cards, potentially
oversimplifying the concept for educational purposes.

Super Auto Pets


...an online game where players build a queue of animals that engage in battles with opposing
animals. Each animal has health points (HP) and attack values, and the game’s outcome is
determined by the survival of animals in the queue.
While Super Auto Pets has some similarities with the game "Sacrifice Must Be Made," it lacks a
direct focus on representing food chain concepts within an ecosystem. The gameplay mechanics
involve random animal battles without consideration for ecological dynamics such as predator-
prey relationships, energy transfer, or the role of plants in the food chain cycle. Furthermore, the
random nature of the battles does not provide players (students) with strategic choices based on
ecological principles.

Super Auto Pets gameplay


As a game Super Auto Pets, is great. The flow of the game is fast and exciting, which makes the
game interesting, but at the same time it does not provide a comprehensive representation of
ecological concepts, focusing instead on arcade-style gameplay without considering the
complexities of natural ecosystems. My game will be educational, but also interesting, so I
decided to inherit the fun part of Super Auto Pets, but include important details.

Conclusion
Since, you are familiar with the games listed above, I can bring this wall of text to a single
conclusion. My game will focus on teaching players about ecological concepts such as food chains,
predator-prey relationships, and the role of plants in ecosystems. The games I talked about are
intended to be fun and entertaining, rather than educational, so they do not solve the problem
completely. What I would like to inherit from these games, is fast flow of the game. What I mean
by that is that each round in each game lasts for 3-7 minutes (in Hearthstone it depends to be
honest) so the player doesn’t have time to get bored, and unfortunately the students can easily
get bored. So my game must be fast in terms of the game dynamics, but I still must stick to the
scientific reliability of my game.

The End User


Lisa is a junior high school biology teacher. Over the years, she has noticed that it is easier to
present information to children using intercative methods, such as quizzes or games. I decided
that Lisa would be my client because my product would help her to teach children complex
scientific concepts such as food chain. With her knowledge of science and her extensive
experience working with children, I will be able to understand the subtleties and the nuances
that the game must have in order to maintain scientific credibility and as much important remain
interesting to children, which will keep them interested in the learning process.
Client meeting
I met Lisa to ask her some questions related to my project, undertstand the problem I am trying
to solve deeper and take some recommendations about developing the educational part of my
game:
1. Could you tell about yourself and in what area you are currently working in?
Lisa: I am a school teacher in a middle school and I teach students science subjects, such as
chemistry, physics, and biology. I’ve been working with great enthusiasm and passion to my jo
and I always search for new ways to educate children in science.
2. Do you meet any difficulties in teaching and do you see ways to improve education for
today’s students
Lisa: Well, I’ve neen working as a teacher for 5 years, and through out that period I noticed that
everything has been changing so fast since the people discovered computers, and education is not
an exeption. Of course we can say that without technologies we are still able to teach, but my
experience says that teaching younger generation with only books and lectures becomes less and
less efficient. So, in my opinion, the best way to educate people is making the learning process
more interactive and interesting, and by using technologies we can come closer to such way of
educating. Especially for kids, who due to their age are very hard to concentrate on something, so
it is very important to make them involved into the lesson, and I think quizes and games are a
great solution.
3. You mentioned games in your previous answer. Does it include the video games also?
Lisa: Depends, let me explain. Nowadays children grow in a technological world with
smartphones instead of toys, which sounds negative at a first sight, but looking from another
point of view, I see a good opportunity for schools to reconfigure the system and make young
people enjoy studying. So yes the video games are great too, but we have to keep in mind that
games must be eucational and not focused on entartaing. Secondly, the way the games present
some scientific material must be accuracte in terms of terminlogy and reliable in matter of
information.
4. Speaking about the game specifically, is card-based game genre a good genre for
teaching at school?
Lisa: I would say that it really depends on what kind you material you’re teaching. For example, if
the topic is Forces, then it is probably bettet to create some simulator with physical objects,
where you can change the mass of an object, the gravitational field strength, et cetera. And for
some biology topics, where the students are being taught about interactions between cells in
blood, which is an extremely hard topic, because you have to memorize the name of each cell, its
functions, its structure and so on, the card-based game is more suitable, because each card can
represent a cell and its function can be its in-game abilities. Cards are good for memorization,
that is why the flash cards are often used for revision, they information is organized into small
pieces of paper, in game those are cards obviously, which makes it easier to find the student’s
knowledge gaps and so on.
5. For my project I’ve decided to make a card-based game with food chain cycle
implementation. Do you have any recomendations on it?
Lisa: Of course, first of all, that’s great that you decided to choose that concept and that game
genre for implementing food chain system, because that would really help me in teaching, as food
chain is all about memorizing and understanding how the system works. The best way to
memorize how the large system works, and the system’s part, is by breaking down the whole
system into smaller pieces, and then creating a whole picture in your head. I would suggest that
each card in your game will represent an animal or a plant, each card might contain small piece of
information about the speices it represents, so the students can also learn a bit about the speices
and the plants themselves. Do not close your eyes to details, because the game you will create,
will be used for educational purposes, and the material being taught in your game must be
reliable, so the amount of lion cards must be smaller than the amount of grass cards, in order to
respect the conditions of wildlife on our planet.
6. Should the game be focused on randomness or is it better to make it more strategy
based?
Lisa: The game you are going to make has to combine both of these things, because nature is
random and ordered at the same time. I would like to have a deck where you take a card, but you
also have to build your own deck, becuase animals can cooperate between each other, so the
students will also learn some symbiosis concepts. Also by adding the strategy part, it can educate
students in a logical way, which is also great for general education and the randomness develops
the critical thinking skill, so as I said your game should make these two uncombinable things
work together.
7. Could you make a brief list of things that the game must include in order to be useful in
education and at the same time remain interesting?
Lisa: First of all, focus on how the things work in the real world and do not miss any details.
Secondly, break down the system into smaller parts, in your project, begin with simple food chain
cycle examples, so that the students can understand an astraction of the whole system and than
gradually add more and more complexity, as in the real world the ecosystem is way more than
just producers, a couple of consumers and predators. And finally, the design of the game should
not be very colorful and the less interface you have the more the students will focus on the
material itself and will be less distracted on a subconscious level.

To conclude
Lisa emphasized the importance of integrating technology into education to captivate the
younger generation’s interest. This underscores the necessity for the game to be not only
interactive but also rigorously educational, ensuring that it retains scientific accuracy and
facilitates effective learning.
The choice of a card-based game genre, particularly for teaching complex biological concepts
such as the food chain, is validated by Lisa’s perspective. She highlighted that card games are
beneficial for memorization and understanding, suggesting that each card represent a specific
animal or plant, providing a snippet of information to facilitate learning. This approach aligns
well with educational strategies aimed at breaking down complex systems into manageable,
learnable segments.
The game’s design should mirror the dual nature of ecosystems, which embody both randomness
and order. Lisa’s recommendation to incorporate elements of strategy and randomness will not
only make the game more reflective of natural processes but also enhance its educational value
by fostering critical thinking and understanding of ecological relationships, such as symbiosis.
Starting with simple examples and progressively introducing complexity is quite important for
educational effectiveness. Lisa focuses on the importance of accurately reflecting the real-world
ecosystem’s complexity, ensuring the game evolves in complexity in a manner that is
pedagogically sound. Moreover, realism in the game’s design, such as the proportional
representation of species, is vital for maintaining scientific credibility.
To keep students focused on the educational content, the game’s design should be simple and not
overly colorful. This approach minimizes distractions and enhances concentration on the
learning material, aligning with Lisa’s insights on the need for a design that supports educational
goals without sacrificing engagement.

Modeling
Now since we have a list of objectives, I would like to talk about the games and dive a little bit
deeper into the development, and talk about implementation of some concpets. The game is
focused on education, so it is important to make the implementation as accurate as possible, but
for now I will talk about the game on the higher level, and closer to the design section (Section 2)
I will explain how things work under the hood.

The Goal
Each game lasts for 40 seconds by defualt. Throughout the time, you have to build as many food
chains or combined chains as possible. You build a chain with cards that you draw from the deck
after each attempt. The more links you used in the chian the more points you get. At the end of
the round the points are stored onto student’s account

The Flow
The chain is made up of cards, which represent a link in a food chain, each card is either
• a photosyntheric (producer),

• a herbivore (primary consumer),

• a carnivore (secondary consumer).

Exactly how it is written in the science school books, right?. There are also omnivores1, but for
now I will omit them.

Simple food chain exmple in Planimals


This is an example of a chain for which you will give 5 points. The links are put from left to right
and the proceeding card "eats" the card on its left.
You can also combine the food chains but they must have a common link at the end, as shown
here (Figure 6):

Combined food chains with one predator at the end of chain in Planimals

1
omnivore: kind of animal that eats either other animals or plants.
I decided that such mechanics will develop student’s knowledge in food chain topic, as they will
understand that one animal can consume lots of other animals/plants.

Common Cards
The card itself will look like the cards shown in figures 5 and 6.

An example of a planimal card


This is only a protype and I may add some changes to it after second meeting with Lisa, because
she is obviously going to give some feedback on the cards, as they are one of the most
interactbale things in the game (if not the most).
So you can see the design is very simple; name, role, image. Lisa said that interface should not be
mottling and blazing, as it may distract students during the lesson. I may also add some
information about the animal’s habitat and its class (fish, reptilesm ampibians, birds, mammals,
etc.), which can teach students about the animals specifically.
I think to add a feature where you can hold the card and it will show you a bit more information
(habitat, class, etc.) about the animal that is shown on the card, so the student can learn a bit
more if they see the animal for the first time.

Simplified entity relationship diagram of the database

The Database
The game will use database to store information about cards, the current game states, and
student’s accounts. Let’s break down these three groups, and I’ll talk about each one briefly.
• Organisms: used for storing information about an organism

• Players: stores the information about students: their username, points earned, etc.

• Relations: contains Prey Predator relations, used for validating chains

• Games: stores the game state, which is time left, points and the username associated with
the game

• Hands: stores cards that the player has

• ChainCard: stores card’s position in a chain

Such structure will help to quickly load cards, track players progress and it also will give the
player an ability to save and load games.

Client meeting 2
After I have a bigger picture of Planimals,I gave Lisa to read Modeling section ask her opinion
whether my game remains educational and interesting, and also discuss some changes.
1. I’d like to hear your thoughts on the game mechanics I’ve developed, particularly the
limited time for each round. Do you have any recommendations?
Lisa: I really like the idea of having a limited time for each round in Planimals. It serves as a useful
warm-up before the lesson and a quick revision method. What I would suggest is making the
entire round limited in time, not just the turns. For example, the round could last for 3 minutes,
and during that time, students have to create food chains as much as possible. When time is up,
the winner is the one with the highest number of points. In general, I think the mechanics are
good. Placing the cards and building the chain is all that is required for a card-based game to be
effective
2. Talking about the feature of combining multiple food chains by placing a common
closing link, such as a predator or a carnivore, what are your thoughts?
Lisa: From a scientific perspective, it may look inaccurate, but I believe it’s beneficial for teaching
purposes. It helps students understand that food chain links can vary and that animals may
consume different animals. I appreciate that you provided an example for such cases.
3. Considering the educational purpose of the game, do you believe this slight deviation
from scientific accuracy could significantly impact the learning experience?
Lisa: That’s a valid concern. While maintaining scientific accuracy is important, I think the
primary goal of the game is to facilitate learning and engagement. As long as students understand
the underlying concepts and principles of food chains, the slight inaccuracy in combining
multiple chains may not be a big deal. It’s more crucial that students grasp the broader concepts
and can apply them effectively.
4. As long as the game effectively teaches the fundamental concepts of food chains and
ecological interactions, such inaccuracy regarding combining chains shouldn’t undermine
its educational value?
Lisa: Exactly. The game should prioritize clarity and engagement. As long as students are gaining
a solid understanding of how organisms interact within ecosystems, the minor inaccuracies
should not detract from the overall learning experience.
5. In that case, I would like to discuss the animals organization and what animals consume.
Lisa: I think organizing information based on groups of most to least consumed animals may
provide some high-level understanding. Students can grasp which species play key roles as both
predators and prey. However, we should ensure that the database reflects real-world ecological
relationships accurately, even if it means sacrificing some simplicity in the game mechanics. It’s
important that students learn the nuances of ecosystems, and an accurate representation in the
game can contribute significantly to their understanding.
6. Does the animals’ ration organization require redesigning?
Lisa: No, I wouldn’t say a complete redesign is necessary, but you should avoid oversimplifying.
It’s important to find that balance between educational depth and gameplay simplicity. Perhaps
we can explore ways to integrate the consumption hierarchy without making the game overly
complex. Let’s aim for a solution that maintains the educational value while ensuring the game
remains engaging and accessible to students.
7. What do you think of a card design I made for Planimals?
Lisa: The inclusion of the animal’s name and role in the food chain is essential for a quick
iedtifying and easy memorization. But, I believe youc can enhance the educational value further
by adding additional information about the plant or animal depicted on the card. This could
include details about its habitat, diet, adaptations, or ecological importance. For example, you
may open some sort of library of cards, where you can take a closer look at the specific animal or
plant.
8. Are there any specific features or functionalities you believe should be included to
enhance the educational value of the game?
Lisa: Definitely. It would be beneficial to include features that provide immediate feedback to
students as they make decisions during gameplay. This could take the form of visual cues or
notifications that highlight the ecological implications of their actions.
9. Are there any specific types of feedback you think would be most effective?
Lisa: In terms of feedback, providing immediate reinforcement for correct answers would be
effective in reinforcing learning. This could be in the form of visual cues, such as highlighting the
correct food chain or providing a congratulatory message. Similarly, offering hints or
explanations for incorrect answers can help students understand their mistakes and learn from
them. Overall, a combination of positive reinforcement and constructive feedback would be ideal
for supporting student learning during gameplay

To conclude
After talking with Lisa about the Planimals modeling section, it’s clear we need to balance fun
with learning. We might tweak some things for the sake of the game, but we’ll always make sure
the main lessons about food chains and ecosystems stay true.
Lisa mentioned how showing which animals eat which could help students understand
ecosystems better. She also suggested adding more info to the cards, like where the animals live
or what they eat, to make learning even richer.
We also talked about giving students quick feedback during the game. Lisa thought it would be
helpful to let them know when they’re right or wrong, so they learn as they play.
Overall, Lisa’s ideas will help us make Planimals both fun and educational.

Final Objectives
1. The Flow

a. General rules

i. One game lasts for 40 seconds by defeault, but it could be changed by the
user in settings.

ii. Throughout that time the player should try to build as many food chains as
possible

1. Start by placing a card, usually a photosynthetic (producer) and then


add a herbivore (primary consumber).

2. Continue by adding carnivores to the chain until you get a chain

3. End the chain by a carnivore, which may be either secondary or


tertiary consumer or an apex predator
4. Allow to make a chain of only two links (for example, grass and a
grasshopper)

5. If the chain is correct you get the number of points, which is equal to
the number of links you used in your chain.

iii. When the time is out, the player can start a new game or exit the game

b. Player’s Actions

i. Takes 5 cards at the beginning and then takes one card after each correctrly
developed food chain

ii. Cards can be drawn from the deck by clicking a Draw button

iii. The cards are placed from left to right, to maintain structure during
iteration of the food chain, when Chain button is clicked

iv. Can place two or more cards on the table, but they must be related such
that, the chain is in correct order, the predecessor must be in the group of
consumed animals that the following animal card. (Mouse Owl, same habitat
and owls eat mice)

v. May be able to combine food chains but both chains must have a last link in
common

vi. Develop a system so that for combined links the points you gain after
completing the chain may

vii. Add special cards that will stop opponent from building food chain. For
example,

2. Frontend Side

a. Card

i. Represents an animal or a plant

ii. The image, name and role in the food chain of an animal is shown on the
card, to quickly idetify an animal/plant

3. Backend Side

a. Organizing Data

i. Create a database with two tables: Organisms and Relations

ii. Entity table contains information about every animal card in the game

iii. Record in the Organisms table contains a scientific name (as a primary key),
a common name (for displaying on cards), a breif descritpion, a habitat, a
role in the food chain, its classification, and group number in consumed
table
iv. Relations table consists of Consumer and Consumed, both of the fields are
binomial names (foreign key from the Organisms table)

v. Relations will be used for checking the validity of the food chain built by a
player

b. Tracking student’s progress

i. Store student’s statistics into another table - Players

ii. Players should store student’s username, email address, and earned points

iii. Make it possible for the user to save the game state by pushing game’s
information (time left, deck, hand, tableaue, etc.) onto the database.

iv. Use tables such Games, FoodChainCards, Hands for storing game’s state

v. Make it possible to continue the game by pulling game’s information from


the database

4. Other

a. Add a book with all common and standard card, to make it available to see more
information about an animal, a plant or a type of pollution

b. Add login and account regestering windows, so that student’s can create and log
into their accounts in the future

c. Use a hashing function like MD5 to store passwords

Design
In this section, I will talk about user’s interface and what happens under the hood in Planimals. I
will paste some code associated with the section.

UX/UI
Lisa said that the interface of the game should not be loaded with different buttons and other
interactions. So, the in-game interface will contain only three main buttons: draw-card, chain-
cards, and exit. Draw-card button will call a Draw() function, which then takes the card from the
deck and puts into the player’s hand. Chain-cards button will trigger the Chain() function, which
will iterate over the player’s chain and validate it (if the chain is a multichain it will also iterate
over the chains). Finally, the exit button just gives an ablity to save the game and quit.
private Button playButton;
public static Button continueButton;
public static Button loginButton;
private Button exitButton;

//..
//other attrinutes not associated with UI
//..
public static Label stats;
public static List<(Card, Point, Point, long, long)> MoveList;
private static Random rnd; Timer timer1;
private Stopwatch sw1;

//..

private Timer readySteadyGoTimer;


private static PictureBox readySteadyGo;
private int imageIndex = 3;

//..

public static int workingHeight;


public static int workingWidth;

//..
public static Rectangle fieldRectangle;
public static Rectangle cardRectangle;

private PictureBox retryButton;


private PictureBox goToMenuButton;
private PictureBox goToMenuInGameButton;

private Button yesButton;


private Button noButton;
private Label youSureWannaQuitLabel;

private PictureBox drawCardButton;


private Image drawCardButtonBack;
private Rectangle drawCardRectangle;

private PictureBox chainButton;


private Image chainButtonBack;
private Rectangle chainButtonRectangle;

private List<Control> gameControls;


private List<Control> menuControls;
private List<Control> endControls;
private List<Control> youSureWannaQuitControls;

private Label label;

private Font largeFont;


private Font smallFont;

Most of the attributes are just techicalities, like Button and Label type variables, but I would like
to discuss some of these.
• workingHeight, workingWidth: makes other controls to be able to dynamically change
size. So for example, if the player has a small screen, the controls also become smaller.
• readySteadyGo: gives the player some time to get ready for the game.

• fieldRectangle: simulates tableaue. It helps to define all set of points, where the user can
click in order to place a card onto the table, or return to hand.

• MoveList, timer1, sw1: used for card’s movement animation.

Draw-card Button(a) and chain button(b)


The game controls will be organized into Lists of Controls for ease of Show()ing and Hide()ing
menu controls when the game starts or ends, for example.
The hand of cards will be represented as a sequence of drawn cards (using Draw()) displayed at
the bottom of the player’s screen. The player can click on the card or pick it and click at point
where they want to move the card. Everytime the user moves a card on the table, it is removed
from the hand. If the user wants to return the card, they would click any point outside of the table
and the card will automatically move to its previous location.
As timer goes off, the game controls are blocked and two buttons appear: Retry and Exit.
Retry Button(a) and Exit button(b)

Game flow
In this section, I will go through the whole process of playing Planimals, so that it is easier to
follow and undertsand complex things like pulling and pushing changes to database or
multichaining.
Everything starts from generating a deck of cards. A generated "deck" is basically a stack of
integers in range from 1 to whatever the number of organisms are currently stored into database.
The amount of cards is 40 for now, but I will make the amount of cards and time for each game
adjustable, so it could be set by the player in settings.
As the deck is generated, the timer starts and now the player is able to draw cards from the deck,
which is a simple Pop() function called onto the deck (later on how I get card object from
integer). The hand size to 15 cards, but I would like to add a "checker" that would make sure that
would iterate through player’s hand and make sure that there are potential food chains, because I
want to handle cases when a player is in a bad luck and their hand does not contain cards that
would make even one chain.
The hand itself is a list of Card objects (I discuss Card class later in section 2.3). Everytime the
player places a card on the table, the card is removed from the Hand list and added to Chain list.
Chain list is a two-dimensional list, that contains lists of cards object. Such structure will enable
multichaining in the game, and it also easier to iterate through the chain when Chain button is
clicked. If the chain is valid then cards are removed from Chain and are disposed, the player also
earns points. If it is not, the cards are moved back into hand and the message that informs about
invalid food chain appeares.
When the time is up, the player can not move, draw, chain the cards. The player can either start
another game or exit by clicking corresponding buttons.
And now we have make sure that the game’s state is pushed onto the database, as well as player’s
points.

MainForm
This class may be considered as a main program. Anything associated with game logic happens
here. Here are the attributes:
public static string username;
public static int totalPoints;
public static Label stats;

//..

private Timer countDownTimer;


private int timeLeft;
private Label labelTimer;

//..
public static Stack<int> deck;
private StringBuilder sb;
public static List<Card> playerHand;
public static List<List<Card>> playerChain;
/..

private int overallScore;

• username: As the user entered their credintals in the LoginForm, the username variable is
assigned, which is then used for quering.

• countDownTimer: a timer that starts immediately after the player pressed play on the
menu

• timeLeft: a variable that decreaments at countDownTimer Tick event, which makes an


illusion of a counting down timer.

Other variable are used for dispplaying information on the screen such as stats and labelTimer.
Lists like playerChain and playerHand store temporary player’s hand and chain. When the game
is loaded the lists will be filled with the cards from the database.

Card class
A planimal card is an object that contains not only information about an organism, but also its
location, size and organism’s picture:
public bool Picked;
public Point prevLocation;
public string scientific_name;
public string common_name;
private string description;
public int hierarchy;
private string habitat;
public static int pictureBoxWidth = MainForm.workingHeight / 8;
public static int pictureBoxHeight = MainForm.workingWidth / 10;

• Picked: the attribute is used for card’s movement. Picked stores boolean type variable,
because the card might be either picked or not. Everytime the player is clicking on a card,
the game iterates over the hand or food chain and searches for an already Picked card, and
Drop()s the Picked card, in order to Pick() another card and the cycle repeats if the player
decides to choose another card. If there is no picked card, the game just calls Pick() onto
the clicked card.

• prevLocation: stores a location of the card before moving it to the chain. The attribute
helps to return cards to the hand, in case if the food chain is invalid.

• Organism’s info: the attributes are used for a fast access to the organism’s info. The player
can right-click the card and get a bit of information about the organism, which would help
building food chains.

• pictureBoxWidth, pictureBoxHeight: both just define the card size. As you may notice the
size is dynamic, as the card’s size depends on the player’s display size.

Connecting database and in-game stuff


To handle data flow between the game and the database, every interaction a player has, whether
it’s logging in, creating an account, or playing, sends or retrieves data from the database tables
shown in Figure 9. Below is a more detailed explanation of how data is managed.

Entity relationship diagram of the database

public static string currentDir = Environment.CurrentDirectory;


private static string dbPath = currentDir + "\\cards.mdf";
public static string connectionString = "Data Source=(LocalDB)\\
MSSQLLocalDB;" +
$"AttachDbFilename={dbPath}" + ";
Integrate Security=True;
Connect Timeout=30";

private static readonly SqlConnection sqlConnection = new


SqlConnection(connectionString);

Loading and storing player’s data


When the player logs in, they click the "login" button, which triggers LoginForm. They input their
username and password. The password, once typed in, is hashed using Hash(), and the resulting
hash is compared to the hash stored in the Players table for that username. If they match, the
player is successfully logged in, and the game can proceed.
During login, the game runs this query:
SELECT * FROM Players WHERE Username = @username AND Password =
@hashedPassword;
If the login is successful, the Username is passed to the MainForm, where the game can track the
player’s progress.
If the player is creating an account instead of logging in, the CreateAccountForm collects their
username, email, and password. The password is hashed using Hash(), and a new record is
inserted into the Players table. The query looks like this:
INSERT INTO Players (Username, Email, Password, Points)
VALUES (@username, @Email, @hashedPassword, 0);

Now, when the player starts a new game, the system checks whether any existing games are
associated with the username. If no games are found, a new game is created in the Games table
with the player’s Username, and the game time and score are initialized:
INSERT INTO Games (PlayerID, Time, Score)
VALUES (@username, @currentTime, 0);

During gameplay, if the player draws or plays a card, the card’s information gets saved in the
Hands or FoodChainCards tables. For example, when a card is added to the player’s hand, the
game inserts a record like this:
INSERT INTO Hands (PlayerID, CardID)
VALUES (@username, @cardID);

And if the card is played on the food chain grid, the game uses this query:
INSERT INTO FoodChainCards (PlayerID, CardID, RowNo, ColNo)
VALUES (@username, @cardID, @row, @col);

As the game progresses, the player’s score may change, and the game keeps updating the Games
table with the new score. For example:
UPDATE Games
SET Score = @newScore
WHERE PlayerID = @username;

If the player logs out or finishes a session, their game data (such as score and time) is updated
and saved in the database, ensuring that they can resume their progress when they return.

Cards, hands, and chains


As I have already discribed how the game is initialized, I will just describe what happens to cards
in the database, assuming that the player has logged into their account.
When the timer starts, the player would click the Draw Button to make a hand. immediately after
clicking the Play Button, the following query is executed
INSERT INTO Hands(PlayerID, CardID) VALUES
('{username}', '{c.scientific_name}');

Hashing passwords
To maintain security of the player’s data, I decided to hash passwords and then store hashed
passwords in the database.
The main property of a hashing function is that it is a one-way function, so I have to easily get an
output so that I can not reverse the process. Modular arithmetic is an example of one way
function, so I definitely use it when converting characters into their corresponding ASCII code. I
would also apply a XOR operator onto the binary string so that small changes in input would
produce an absolutely different output.

References
• Omnivores: https://www.qrg.northwestern.edu

• Sacrifice Must Be Made: https://breezewiki.com

• Hearthstone:
– https://en.wikipedia.org/wiki/Hearthstone

– https://breezewiki.com/hearthstone/wiki/Gameplay

• Species: https://www.worldwildlife.org/species

• Herding: https://www.turito.com/learn/biology

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy