Skip to main content
GameDev.net gamedev.net
🔒 Locked

OO Practise Projects?

Started by Big Sassy Jul 22, 2002 at 3:05 PM 17 replies 1.2k views
Original Post
Big Sassy
Big Sassy
Hey everyone. I''ve just got done reading a bunch of books (Code Complete, Design Patterns, Effectice C++, Generic Programming and the STL, Effective STL) and I wanted to apply all that I''ve learned on a project. Can you guys suggest any projects I could work on that would let me apply all the OO knowledge that I''ve gained? It would be nice if the project wasn''t Win32. Just a nice console app that doesn''t need to look pretty. Here''s a few ideas I came up with: 1. A Calculator program 2. ??? 3. ??? Ok, so I''ve only come up with one. Can anybody think of anything else? ***********************           
Crispy
Crispy
A Nethack clone
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
WayfarerX
WayfarerX
I think a calculator would be a very poor problem to apply objects to, insofar as the calculator does not analyze economic activity, weather patterns, or some other exceedingly complicated task. The only piece of the program that I imagine would benefit from objects is the UI, which you want to stay away from. Perhaps a better idea would be a simple scripting language that only processes mathematical statements.

Another idea would be any type of network daemon, like an http server or proxy. I mention http specifically because it is a very easy protocol to get a handle on quickly, but implementing a full-featured, robust & secure server or proxy can get very hairy. This lends itself well to learning objects since, as you expand your server to include and support various parts of the spec, you will clearly see what parts of your design have succeeded and which have failed by how much work you have to do.

This will lead to self-critique, improvement, and eventual happiness...although the last one has yet to be confirmed.

[edited by - wayfarerx on July 22, 2002 4:42:30 PM]
"There is no reason good should not triumph at least as often as evil. The triumph of anything is a matter of organization. If there are such things as angels, I hope that they're organized along the lines of the mafia." -Kurt Vonnegut
JuNC
JuNC
How about these:

)Basic Virtual Machine/Assembler
)Basic Raytracer
)A texture generator (create some nifty filter effects, blend them together and export to a .tga or whatever for viewing)
)Poly Soup->BSP generator
)Particle Cloud->Inertia Tensor calculator
)Program that generates XHTML from a template file and some data files

Big Sassy
Big Sassy
quote:
Original post by WayfarerX
Another idea would be any type of network daemon, like an http server or proxy. I mention http specifically because it is a very easy protocol to get a handle on quickly, but implementing a full-featured, robust & secure server or proxy can get very hairy. This lends itself well to learning objects since, as you expand your server to include and support various parts of the spec, you will clearly see what parts of your design have succeeded and which have failed by how much work you have to do.

This will lead to self-critique, improvement, and eventual happiness...although the last one has yet to be confirmed.
That sounds like a great idea. But I have no idea where to begin. How should I get started? I really don''t know that much about the subject (which is good because I can now learn it). What do you mean by server? Something like Apache? And what do you mean by proxy? Something like WinGate? What kind of information should I be looking up to get started? Is this this kind of information I should be looking at? What about information on how to actually program it? Do I need to learn about programming sockets and stuff? I really appreciate you giving me advice.

***********************
          
Mandesean
Mandesean
Hello!

quote:
Is this this kind of information I should be looking at?


Yes. The HTTP rfc will show you how such a server (like Apache) should ideally work. You''ll find it *very* informative, I''m sure =P

quote:
Do I need to learn about programming sockets and stuff?



I haven''t implemented a web server myself, but you''ll definitely need to know and understand sockets and such in order to make one.


Mandesean
WayfarerX
WayfarerX
Big Sassy: In response to your questions, in order:

- You should get started as you would any other project. Write a few experiemnts to get the basics of sockets down, read up on HTTP, then just try to write a server that listens for requests and dumps them to the standard output. Play with the data a little. Does IE send the same stuff as Mozilla? What''s different? Etc, etc. When you feel more comfortable with what you''re doing, try to design your basic server.
- By server I mean the process that runs on your machine servicing requests (most commonly) from port 80.
- Yes, excellent example and an even better resource.
- A proxy generally sits between the client and server and does some important task like caching or subverting the firewall.
- Essentially, yes.
- See next.
- Yes, exactly.
- Since http is all text, you only need to know network programming to ''program'' it.
- Yes, enjoy.

However, if you''re clueless on network programming, starting with something offline might be easier (up to you, you know how fast you can pick things up). Something like JuNC''s XHTML generator might be a good idea of something smaller you could build, then later incorperate into your server (this, as we know, being the ultimate test for any object design: incorperation into a completely different system).
"There is no reason good should not triumph at least as often as evil. The triumph of anything is a matter of organization. If there are such things as angels, I hope that they're organized along the lines of the mafia." -Kurt Vonnegut
SnprBoB86
SnprBoB86
you could make a simple text based RPG game.

You could apply OOP concepts to all the characters and monsters and weapons and everything. You could make use of polymorphism by providing a method like "DoTurn" which would simulate a monsters turn based on the monster type it was. There are many other classes you could write including the command parser or things like that.

This was my first C++ project that invovled classes. And while the project was quite lame in the end (seeing that I screwed a ton of stuff up) it was definitly worth the experiance. I was going to go back and rewrite it from scratch with my new knowledge, but instead I walked my friend through it when he was learning to program and the design we came up with and the end product was much nicer.

-SniperBoB-
Big Sassy
Big Sassy
JuNC and SnprBoB86, thanks for the suggestions. I will probably try out some of your idea''s later JuNC. And the text based RPG sounds cool, but I like WayfarerX''s idea. And thanks for the advice, Mandesean and WayfarerX. I think I''m going to dive right in and design a basic server. If anybody has any more advice, feel free to post

***********************
          
EvilCrap
EvilCrap
if you cant think of anything to do after reading all of those books, then you probably didnt look at the examples in any of them. i suggest you go and reread, this time actually attempting to apply some of the stuff, if only in your head (bare minimum).
Big Sassy
Big Sassy
quote:
Original post by EvilCrap
if you cant think of anything to do after reading all of those books, then you probably didnt look at the examples in any of them. i suggest you go and reread, this time actually attempting to apply some of the stuff, if only in your head (bare minimum).
Whoa there, EvilCrap. Who said I didn''t look at the examples? Who said I didn''t apply any of the stuff I learned? Here''s what I said:

"I''ve just got done reading a bunch of books (Code Complete, Design Patterns, Effectice C++, Generic Programming and the STL, Effective STL) and I wanted to apply all that I''ve learned on a project."

As in something more than 10 lines of code. Applying stuff from the C++ and STL books is easy. Same with Code Complete. Applying stuff from the Design Pattern''s book is a little more tricky. Sure I could just write generic classes that made use of some of the patterns, but that wouldn''t help me too much. It''s just like when you''re learning mathematics. You can do Geometry problems all day, but when you actual apply it to something (like a game), it makes much more sense.

And that''s the hard part. Since I only have a little experience designing OO programs elegantly (not just mashing a bunch of classes together), I figured somebody here with much more experience could suggest a project that really flexed their OO skills. And sure enough, WayfarerX and JuNC had some cool ideas that I probably wouldn''t have thought of. So next time think before you post. And try not to make blind assumptions.

***********************
          
DerekSaw
DerekSaw
Hmm... why not have a project that is useful and FREE for everyone to use.. and for your own experience as well... a Whole Tomato''s Visual Assist clone!! Make it robust (no resource leak?), make it stable (no unreferenced pointers?), make it responsive (multithread?).
"after many years of singularity, i'm still searching n the event horizon" o
Void
Void
Write a flexible GUI library.
Big Sassy
Big Sassy
quote:
Original post by Void
Write a flexible GUI library.
That's exactly what I planned on doing later. However, I wan't to get some more experience before I dive into that. I plan on completely rewriting my directX wrapper and graphics objects. When I do that, then I'm going to make a set of GUI objects that I can incorporate into my games. *edit* I figured that if I do a good job designing the interface to all of graphic objects it should be really simple to create the GUI components. */edit* But yeah, that's a really good idea *edit* Keep 'em coming. At the very least, I'm sure somebody else could find some ideas for their next project. */edit*

***********************
          

[edited by - Big Sassy on July 22, 2002 10:28:51 PM]
levendis
levendis
In my first university programming course the final project was to implement the game Mancala. I don''t have any links handy as to the rules but they''re pretty simple and can be found quickly on google. Almost any simple game, even board games, encapsulates most of what''s behind object oriented programming. Maybe abalone?
------http://www.livejournal.com/users/rain_is_wet/
DerekSaw
DerekSaw
quote:
Original post by Big Sassy
That's exactly what I planned on doing later....


Make sure your GUI is exception-safe. Try it by sprinkling random throw statements all around your GUI code and see what will come out.


[edited by - DerekSaw on July 23, 2002 11:20:33 PM]
"after many years of singularity, i'm still searching n the event horizon" o
Big Sassy
Big Sassy
quote:
Original post by DerekSaw
Make sure your GUI is exception-safe. Try it by sprinkling random throw statements all around your GUI code and see what will come out.
Good advice

***********************
          

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.