• 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
DZee

Wrote First Game[SDL/C++] - Feedback

6 posts in this topic

Hey guys, some colleague of mine asked me to learn SDL. So yesterday I went and skimmed the API along with one or two tutorials. I figured I'd start slow so I wrote this Tic Tac Toe game.

I wouldn't mind any kind of feedback either on the code or the game, anything is appreciated. It's written in C++. I was cut short because of a work project(Income!!!) so I didn't implement any proper AI unfortunately. Took around 8 hours, I had forgotten a lot of things about C++ since most of my experience comes from Java Swing(Eww). Everything is from my mind, my pencil and a blank sheet of paper. Didn't want to inspire myself from any of the popular methods for finding the winner, I will take a peek into the AI algorithm just for my personal culture though.


Expect to see more interesting games coming along with each step I take. I'm probably going to make a <game of life> type just because I'm curious and then probably a poker game(I wrote an engine in Java a year ago), then probably step away from turned based games and go on to make the best game in the world[img]http://public.gamedev.net//public/style_emoticons/default/ph34r.png[/img] .


Worst case scenario this might help someone or inspire people.


Have fun.

---
Oh I forgot, my laptop is in repair so I had to use the dreaded Visual Studio so I can't offer any makefiles for Unix

-----
Oh yeah and, I haven't tried multiple grid sizes. There's no loop to construct the frame initially so that would have to be done manually... my fault [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Edited by DZee
0

Share this post


Link to post
Share on other sites
The dreaded Visual Studio? Visual Studio is dreaded? Why? (Well, okay, I guess the C++11 support is somewhat lacking...)

After spending a couple minutes looking, I found a couple of odd things:
1) People still use RAR files?
2) Of the files Visual Studio generates, the only files vital to building the project are the .sln and .vcproj. The rest -- .sdf, the intellisense database; .suo, the solution options (??); the .vcxproj.user -- aren't needed, should be deleted.
3) Do not distribute the Debug versions of your executable. The debug versions of the C runtime library are intended for development only, not for deployment.
4) Multiple copies of the res directory?
5) (Nitpick) Your vcproj assumes I have SDL installed in C:\SDL-1.2.5 -- I actually have it installed in C:\bin\sdk\SDL\1.2.5. It doesn't really matter as long as your project links to an SDL.lib, and I have properly set up the appropriate directory.

I'll take a much thorough look inside your project later...
-2

Share this post


Link to post
Share on other sites
IMO, I would replace
[source lang="cpp"] buttons[0] = new Button(0, 0, 200, 200, tileClips[Empty]);
buttons[1] = new Button(200, 0, 200, 200, tileClips[Empty]);
buttons[2] = new Button(400, 0, 200, 200, tileClips[Empty]);
buttons[3] = new Button(0, 200, 200, 200, tileClips[Empty]);
buttons[4] = new Button(200, 200, 200, 200, tileClips[Empty]);
buttons[5] = new Button(400, 200, 200, 200, tileClips[Empty]);
buttons[6] = new Button(0, 400, 200, 200, tileClips[Empty]);
buttons[7] = new Button(200, 400, 200, 200, tileClips[Empty]);
buttons[8] = new Button(400, 400, 200, 200, tileClips[Empty]);[/source]
with something along the lines of
[source lang="cpp"] const int BOARD_W = 3; // in tiles
const int BOARD_H = 3;
const int BUTTON_W = 200; // in pixels
const int BUTTON_H = 200;

int i = 0;
int j = 0;

for(i = 0 ; i < BOARD_H ; i++)
{
for(j = 0 ; j < BOARD_W ; j++)
{
buttons[i*BOARD_H + j] = new Button(i*BUTTON_H, j*BUTTON_W, BUTTON_H, BUTTON_W);
}
}[/source]

because this avoids some repetition and also allows you to change the board size easily, if you wanted to add an option for a 4x4 game, or if you want to change the tile size easily for changing screen resolution, using different graphics etc. Edited by arrrgh
1

Share this post


Link to post
Share on other sites
[quote name='fastcall22' timestamp='1341376826' post='4955515']
People still use RAR files?
[/quote]
I do.. what's wrong with rar files? =P Rather use that than zip.. JAR, now that's a legacy format. Haven't seen that in years and years
Moving on..

[quote name='fastcall22' timestamp='1341376826' post='4955515']
Your vcproj assumes I have SDL installed in C:\SDL-1.2.5 -- I actually have it installed in C:\bin\sdk\SDL\1.2.5. It doesn't really matter as long as your project links to an SDL.lib, and I have properly set up the appropriate directory.
[/quote]
How [i]do[/i] you set up the appropriate directory? I've never found a good standard way for looking up libraries depending on the user. I always get frustrated with msdn. It's worked for me so far, because I mostly handle my development alone.
0

Share this post


Link to post
Share on other sites
[quote name='Zoomulator' timestamp='1341393598' post='4955573']what's wrong with rar files? =P Rather use that than zip..[/quote]
WinRAR is what's wrong with RAR files. I find [url=http://7-zip.org]7-zip[/url] as a much superior (and free) alternative.

[quote name='Zoomulator' timestamp='1341393598' post='4955573']How [i]do[/i] you set up the appropriate directory?[/quote]
You can only setup the appropriate directory for your own machine. Anywhere else and you'll need to either trust the user has the appropriate directory setup or distribute the libraries with your project and use those.

Visual Studio's property sheets are a step forward, in my opinion. These allow you to change your project properties in layers. If you were to create and include in your project two property sheets, "SDL_1.2.5-debug" and "SDL_1.2.5-release", that add your SDL's include/library directories, and then distribute your project without those property sheets (remember, they reference directories in your harddrive), then the developer (once presented with an error message or reading your readme.txt) on the other side will substitute his own versions of those property sheets so that your project will point to his SDL directory.
0

Share this post


Link to post
Share on other sites
[quote name='fastcall22' timestamp='1341376826' post='4955515']
The dreaded Visual Studio? Visual Studio is dreaded? Why? (Well, okay, I guess the C++11 support is somewhat lacking...)

After spending a couple minutes looking, I found a couple of odd things:
1) People still use RAR files?
2) Of the files Visual Studio generates, the only files vital to building the project are the .sln and .vcproj. The rest -- .sdf, the intellisense database; .suo, the solution options (??); the .vcxproj.user -- aren't needed, should be deleted.
3) Do not distribute the Debug versions of your executable. The debug versions of the C runtime library are intended for development only, not for deployment.
4) Multiple copies of the res directory?
5) (Nitpick) Your vcproj assumes I have SDL installed in C:\SDL-1.2.5 -- I actually have it installed in C:\bin\sdk\SDL\1.2.5. It doesn't really matter as long as your project links to an SDL.lib, and I have properly set up the appropriate directory.

I'll take a much thorough look inside your project later...
[/quote]

Dreaded because I do not like how VS handles properties for different projects. Give me makefiles any time of the day. Perhaps I am just used to the Unix way of dealing with these. I do use VS at most places I work though.

1)
Well yes it's true that I did some tests at some point in time and Zip files were superior in pretty much every category against rar files. I guess I'm used to WinRar. I would have tarred it if I was on Unix.

2),3)
You are right, sorry about that I was lazy.

4)
Essentially the res directory was unique, but I copied it in the .exe for a quick run for anyone who was interesting in trying it out. I think I left the .bmp too for no reason. Packaging again, my fault [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

5)
I normally use environment variables(Such as creating SDL_DIR="path"), It would have fixed your problem per se, but it would have facilitated the integration.



@arrgh, yes indeed, I mentioned the loop earlier my fault, thanks for pointing out it's importance.

---
Thanks for the input. Edited by DZee
0

Share this post


Link to post
Share on other sites
[quote name='fastcall22' timestamp='1341376826' post='4955515']
The dreaded Visual Studio? Visual Studio is dreaded? Why? (Well, okay, I guess the C++11 support is somewhat lacking...)

After spending a couple minutes looking, I found a couple of odd things:
1) People still use RAR files?
2) Of the files Visual Studio generates, the only files vital to building the project are the .sln and .vcproj. The rest -- .sdf, the intellisense database; .suo, the solution options (??); the .vcxproj.user -- aren't needed, should be deleted.
3) Do not distribute the Debug versions of your executable. The debug versions of the C runtime library are intended for development only, not for deployment.
4) Multiple copies of the res directory?
5) (Nitpick) Your vcproj assumes I have SDL installed in C:\SDL-1.2.5 -- I actually have it installed in C:\bin\sdk\SDL\1.2.5. It doesn't really matter as long as your project links to an SDL.lib, and I have properly set up the appropriate directory.

I'll take a much thorough look inside your project later...
[/quote]

All of your arguments are nitpicks. Seriously, your 1st criticism's is he used rar for compression.

There are some valid criticism's, but your's, especially about how he distributed the code, are unwarranted.
1

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