Public Group

Beginner questions, (SDL, and generals)

This topic is 4437 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

My friend has been working on images and rules for a 2D card game, based off of the popular Warcraft series. The game will be graphical and features, a battle area, and many cards/spells/ whatever else he can think of. Guess who he wants to do ALL the programming :). Seeing as how I'm obviously still learning, how long until I should be able to get something started. I'm reading this book. . . http://www.amazon.com/gp/product/1592002056/102-7684400-1047316?v=glance&n=283155 . . . and I'm not sure if I covers everything to the point that I should feel comfortable with moving on to SDL. It covers a lot of great things, but also misses some important bits like streaming. With beginning SDL as my main goal, how long (In your opinion), until I should start?

Share on other sites
The book is more than enough for you to learn so you can go onto SDL. Actually, you should be fine after the pointers chapter, but it's a good idea to go and read all of it first, as in the end are a lot of advanced topics such as classes and polymorphism.

But - if you're new to programming, start out by making small text-games first. Get some experience with the language once you read the book, and then start SDL as you will be more comfortable.

Good luck!

Share on other sites
Having one person think up rules and another person implement the code is doomed to fail. Your friend probably thinks all his rules are just fine and dandy, but not all rules translate well into code due to non-obvious ambiguities which humans can easily sort out but computers cannot. Consider Magic the Gathering. There you have cards which say things like "May be played immediately if opponent plays X." This is a type of rule which works great for card games, but is an absolute horror to turn into a computer game. Also, consider a rule like "When this card is in play, all Arcane Magic attacks will fail." Simple, right? Not quite. This means that any Arcane Magic cards being played will need to search for the presence of this card. And that means that the rules of any given card can no longer be contained within that cards definition, but must be spread out all over the place, leading to a mess that at first looks managable, but just gets worse and worse for every new card added.

Your life would be much easier if you had one person coding and thinking up rules, and the other person doing art.

Share on other sites
Wiggin is probably right that the types of rules created by a game designer are not the same as the types of rules that a programmer finds easy ways to implement while working on a project. But that doesn't mean the division of labor is wrong. I have never once designed my games in terms of their implementation, you design your games in terms of their core operation - irrespective of their eventual coding in computer form, this gives them life and depth beyond the program.

There should of course be pauses to reflect and discuss how a feature might be able to be implemented in a computer game, but since their are so many ways to go about building your game logic, it is often better to make the programmer look at what they must acomplish in their architecture / design phase than to make the game designer think of implementation during the game design phase. Most good game designs can become both computer and non-computer games (at least for the type of game you are talking about ... obviously arcade style and action oriented games are made FOR the computer, not as games in their own right).

Share on other sites
Early Development Rules:

Warcraft: Trading Card Game MaterialsTo begin a duel you must have a deck consisting of unit, spell, gather, kingdom, and fortification cards. You’ll of course need an opponent to duel who has the same materials listed above.  Object of the GameThe object of Warcraft is to destroy your opponents Kingdom before he destroys your own. You also win if your opponent has to draw a card when no more remain in his deck.How to Start the GameYou start the game by selecting the 4 structures cards inside of your deck that will make up your Kingdom. Place these onto the games Kingdom Play Area. The Kingdom Play area is behind the Battlegrounds and in front of the Resource Depot. Roll a dice or flip a coin to decide who will go first. The player who goes first skips the draw step and cannot draw a card from his or her deck this turn. Shuffle the deck in front of your opponent as he does the same. Then draw the top 7 cards from the top of your shuffled deck. If you do not like your starting hand you have the option to mulligan. When you mulligan your hand is shuffled again into your deck and draw a new hand with one less card (6). You can mulligan as often as you like but must draw one less card each time. When both players are satisfied with their starting hands the battle may begin. Parts of a Warcraft Card Name: A card’s name is located in the upper left hand corner of the card. When a card name is found in the lower text box it only refers to that specific card and not other copies of it in play. Upkeep Cost: Each number found in the upper right hand corner of the card is the cost to play that specific card. For example, if a card needs 4 Upkeep Points to be played then the appropriate amount of gather cards (4 in this case) must be tapped.Card Type: Located underneath the card’s name, this text tells the player whether the card is a unit, spell, enhancement, equipment, gather, fortification, or kingdom. If the card is a unit type (such as an Orc or Human) the text will appear next to the word “unit." If it is a kind of enhancement card that attaches to a Unit or is applied to a Gather card it will read “Enchant Unit" or “Enchant Gatherer." Season Symbol: The symbol tells you which edition of Warcraft TCG this specific card is derived from. If it displays the number 1 for example the card hails from the first edition Warcraft card game. Rank: The ranking symbol appearing after a cards name indicates the cards rarity. The lower the cards rank the lower its rarity and vice versa. Text Box: Located under the cards portrait is the text box where a cards abilities appear. Flavor text may also appear in the text box, but has no effect on the game and will appear in ITALICS.  Power and Vitality: Located in the lower right hand corner of the card, the Power rating displayed first followed by the cards vitality rating. These numbers are used to decide who wins in combat on the Battlegrounds. Key Terms and SymbolsUpkeep Points: Upkeep points are what you use to pay most costs of cards in Warcraft. Gatherers who retrieve resources in the Depot make Upkeep points made useable by the player. Each Gatherer generates one Upkeep point per turn and points that are unspent cannot be redeemed on the players next turn. Permanents: Unit, Enhancement, Fortification, Kingdom, and Equipment cards are put into play when their Upkeep cost is paid. Gatherer cards also stay in play when you have played them. These cards are known as Permanents because they continue to stay in play unless something removes them from play.  (Spells played during the course of the game go directly to the grave yard after play.) Tapping: Tapping is the process used in Warcraft to show that the card has been used. A tapped card is turned sideways. At the beginning of a players turn the card is then untapped and can be used once again. Target: When a spell or unit card contains the word “Target" you choose what it’s spell or ability will affect when you activate it. For example, depending on the spell or ability, targets can be unit, spell. fortification, Kingdom, Equipment, Enchantment, and Gatherer cards. Damage over Time (DoT): Generally abbreviated as DoT. This refers to inflicting some damage on one's foe which will be applied at a regular interval for a limited duration. A DoT may be applied using a variety of methods - from a spell, a trap, a weapon, a poison or some other form. DoT’s are generally target specific. Healing Over Time (HoT): Generally abbreviated as HoT. This refers to healing some damage on one's self or an ally which will be applied at a regular interval for a limited duration. A HoT may be applied using a variety of methods - from a spell, a bandage, eating food, a potion or some other form.Area of effect (AoE): Area of Effect abbreviated as (AoE), affects multiple units while on the battlegrounds by causing either damage, healing, or applying negative or positive statuses. Buff / Boost: a "buff" or “boost" refers to a temporary beneficial spell or effect placed on a player. which can be applied at a regular interval. Debuff: A “debuff" is the contrary of a buff. It is an effect which is not generally instant, but has a duration or lasts forever, which hampers the target in some way. Among other effects, debuffs frequently lower attributes, reduce abilities or simply deal damage to the target.Card TypesUnit: Unit Cards are permanents that can attack and block. You can play Unit cards during your main phase. Located in the lower right hand corner are a set of numbers. The number on the left of the slash indicates the Unit cards power rating, the amount of damage it deals while in combat on the Battlegrounds. To the right of the slash is the Unit’s vitality, the amount of damage needed to destroy that unit.  	Units cannot attack if it has an ability that requires the unit to be tapped. Enhancement: Enhancements are permanents that are played during a players main phase. There are two kinds of enhancements: Those capable of standing alone while in play and others that attach to other Unit’s to provide a boost in stats. Enhancements that stand on there own will be simply printed as "Enhancements." Enhancements that attach to Units, Fortifications, Kingdoms, and Gatherer will read as either “Enhancement Unit, Enhancement Fortifications, Enhancement Kingdoms, or Enhancement Gatherer." 	When an Enhancement is played it must target another permanent on the field to attach itself to. This means when an Enhancement card is played the player must decide what card types listed above to attach it to. 	If a permanent with an attached enchantment is destroyed the enchantment along with the permanent is also destroyed.  Gatherers: Gatherers are cards that both do not count as spells, meaning they cannot be countered, and are not Unit cards meaning they cannot attack or block like other Unit cards, unless stated otherwise. Gatherers are permanent cards, and the Upkeep points they produce while in the Resource Depot pay for other spells and unit cards. You may only play one Gatherer card per turn during the main phase. Spells In the game of Warcraft there are two methods to casting spells. Spells are either channeling or instant cast. There are several different schools of magic such as: fire, shadow, holy, frost, arcane, and nature. Types of spells include: HoT’s, DoT’s, Buff’s, Debuffs, and AoE’s. Channeling Spells: Channeling spells are a type of spell that can only be played during your main phase. Channeling spell cards go to their owner’s graveyard after being played. Instant Cast Spells: Instant cast spells are magic turns that you can play at anytime, even during your opponents turn or in response to another spell. Like Channeling spells after being played they are sent to their owners graveyard.

Share on other sites
Hey, I'm just starting to program C++ and I have a problem. I have been trying to run an EXTREMELLY basic program to add 5 numbers together. Whenever I try to run the program, the only thing that pops up is the cmd.exe which simply asks that I press any key to continue. I can't get to the source code at the moment which is a kill but if anyone can give any direction to me without it, I would be very happy

Share on other sites
Quote:
 Original post by Boboclock367Hey, I'm just starting to program C++ and I have a problem. I have been trying to run an EXTREMELLY basic program to add 5 numbers together. Whenever I try to run the program, the only thing that pops up is the cmd.exe which simply asks that I press any key to continue. I can't get to the source code at the moment which is a kill but if anyone can give any direction to me without it, I would be very happy

Sort of unrelated, but to be honest nothing can be done without source code. Pretty much anything could cause that to happen.

Share on other sites
Sorry, by Beginner questions I thought It was, you may post beginner questions here. In anycase, here is the code

//
// Program to add five numbers
//
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
// enter first number
int numbone;
cout << "Enter Hours for Monday:";
cin >> numbone;

// enter second number
int numbtwo;
cout << "Enter Hours for Tuesday:";
cin >> numbtwo;

// enter second number
int numbthree;
cout << "Enter Hours for Wednesday:";
cin >> numbthree;

// enter second number
int numbfour;
cout << "Enter Hours for Thrusday:";
cin >> numbfour;

// enter second number
int numbfive;
cout << "Enter Hours for Friday:";
cin >> numbfive;

int sum;
sum = numbone + numbtwo + numbthree + numbfour + numbfive;

// output the results (followed by a NewLine)
cout << "The Sum is:";
cout << sum << endl ;

// wait until user is ready before terminating program
// to allow the user to see the program results
system("PAUSE");
return 0;
}

Please show me whats wrong. Thanks

Share on other sites
That code works just fine for me.

Share on other sites
Well bloody hell. Wonder why I can't run it. Thanks Anyway though.

1. 1
2. 2
JoeJ
20
3. 3
frob
19
4. 4
5. 5

• 10
• 11
• 12
• 13
• 9
• Forum Statistics

• Total Topics
632206
• Total Posts
3004772

×