• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Chad Smith

Planning Code for Blackjack Game

3 posts in this topic

QUICK NOTE: The language in C++, though for code design don't think it matters that much.  Just wanted to point that out if someone had a better design or language feature for me.

 

I wanted to see if I could get a review or some advice on my current plan and code design right now. This is my first time to really go and try to design classes, functions, and members that I'll need for a game or a project.  So I wanted to try to start with a "simple" game that I've created before but wanted to try to plan out the code before I actually started working on the code.  Even though I do want a "proper" design and want suggestions for that, my main thing is really is their anything glaring wrong that I will need to look out for?  Anything else you see that I need to add?  Even though I am sure when the coding does actually start I'll see some things that I need to add or change.

 

I didn't create a UML diagram for it, but really made a table for the classes I need and a table for each class listing each member and a brief description why I need it.  I plan to try to create a simple UML diagram for it when I get the time to read up and find a good editor to help create a UML diagram.

 

Anyway here are my tables (just quick screenshots)

[url=http://postimg.org/image/w2qy7z9gp/full/]Black_Jack_Code_Design1.png[/url]
[url=http://postimage.org/]tinypics[/url]
 
[url=http://postimage.org/]Black_Jack_Code_Design2.png[/url]
[url=http://postimage.org/]imagevenue[/url]
 
 
Quick walk through and thoughts behind some of it.
Hand Class: I tried to represent cards as real-life cards.  A Hand is a collection of cards.  After thinking about how cards are in real life I thought that we don't copy a card when you deal it.  The card is moved.  That for me made me store the collection of Cards as a vector of Card pointers.  When Cards are moved from Hand to another the pointers will be copied and destroyed. I am unsure if this would be abusing the use of Dynamic Memory.  When I Clear I am pretty sure this would ask for me to iterate through all the cards and delete the current iterator.  I feel I could be abusing and not using Dynamic Memory in a proper place.  Maybe some help here or help me visualize it different, as I only see cards moving and not actually be copying in real life?
 
Generic Player: I wanted to create an abstract base class to store the common functionality of a human player and computer player.  Felt like it would be easier to allow multiple types of players this way.  I at first thought a player was really just a hand in the game, but after thinking about it more I wanted it to be that a player and hand is a Has A Relationship, so I every player will store a hand
 
Player: Just the functionality that a human player has
 
ComputerPlayer: Just the functionality that a computer player has.  Their will always be one ComputerPlayer, being the House
 
Deck: Just a standard deck of 52 cards.  The Deck deals the cards to the players.  Because it deals the same way to each player I use GenericPlayer so it works for both human players and computer players.
 
 
That's just some quick thoughts that I had.  What do y'all think?  Some things I should look at?
 
NOTE: This will just be a basic Blackjack game to work on planning out my code.  Players won't be able to bet, raise or anything like that right now.  Just a simple game of Blackjack where the player can play a round or two.
 
 
 
 
 
Edited by Chad Smith
0

Share this post


Link to post
Share on other sites

Nothing looks particularly wrong here.  I'd actually say it is way over thought out at this point simply because the problem is so small in scope.  Practicing planning is one thing, drawing up the above when it basically encompasses the entire game and you could probably have a testbed functional by now, that's another thing.  The rules are down right simple and you've probably written up more planning than there is actual code needed to implement it.  I don't mean to offend, just trying to be practical.  :)

0

Share this post


Link to post
Share on other sites

Nothing looks particularly wrong here.  I'd actually say it is way over thought out at this point simply because the problem is so small in scope.  Practicing planning is one thing, drawing up the above when it basically encompasses the entire game and you could probably have a testbed functional by now, that's another thing.  The rules are down right simple and you've probably written up more planning than there is actual code needed to implement it.  I don't mean to offend, just trying to be practical.  smile.png

No offense taken at all and I'd normally agree.  One reason I wanted to try to do it this way is to try to create something that would allow to expand on it later on.  I always felt my code on my projects has been entirely too hard coded.  So I wanted to try to work on something.

 

Thanks for comment though!  If anyone has any suggestion or comments then I am still all ears.

0

Share this post


Link to post
Share on other sites

Nothing looks particularly wrong here.  I'd actually say it is way over thought out at this point simply because the problem is so small in scope.  Practicing planning is one thing, drawing up the above when it basically encompasses the entire game and you could probably have a testbed functional by now, that's another thing.  The rules are down right simple and you've probably written up more planning than there is actual code needed to implement it.  I don't mean to offend, just trying to be practical.  smile.png

No offense taken at all and I'd normally agree.  One reason I wanted to try to do it this way is to try to create something that would allow to expand on it later on.  I always felt my code on my projects has been entirely too hard coded.  So I wanted to try to work on something.

I think the problem is that BlackJack, as a testbed for your experimentation, is a bit too simple.  The only real complexities are doubling down and splitting which I didn't see in the outline.  I would think a more complex card game, perhaps poker, would give you considerably more to work with without being too much.  It is just a thought.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0