![]() |
| | #1 |
| Registered User Join Date: Feb 2008 Location: Lehi, UT
Posts: 179
| The biggest project I've worked on: ASCIIpOrtal Meanwhile, you can get more information here as well as downloading the source and windows binaries: ASCIIPortal development
__________________ Type-ins are back! Visit Cymon's Games at http://www.cymonsgames.com for a new game every week! |
| guesst is offline | |
| | #2 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| My only suggestion is to use SDL_mixer if you want to use sound with the SDL. (But you probably were going to anyway.) Good luck, looks good so far! (I might have feedback once I get it working on my machine . . . .)
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort |
| dwks is offline | |
| | #3 |
| Registered User Join Date: Feb 2008 Location: Lehi, UT
Posts: 179
| IIRC your system was Linux. Lemme know if you needed to do anything to get it running. You know me, I like to think that I'm being cross-platform compatible.
__________________ Type-ins are back! Visit Cymon's Games at http://www.cymonsgames.com for a new game every week! |
| guesst is offline | |
| | #4 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| You do indeed recall my system correctly. With some minor modifications, I got the code to compile. I eliminated some warnings, but didn't try to get rid of the signed/unsigned mismatch ones since there were so many -- enable compiler warnings! ![]() Anyway, changes required for Linux compliation: Code: $ diff original/main.cpp main.cpp
8a9
> #include <cstdlib> // added by DWK
112c113
< check++);
---
> check++) ;
231c232
< int fireportal (int por, int pl) {
---
> void fireportal (int por, int pl) {
419c420
< case BOULDER:
---
> case BOULDER: {
445a447
> }
488c490
< int player;
---
> int player = 0;
491c493
<
---
>
538c540
< name = mappack + "\\" + mappack + num.str() + ".txt";
---
> name = mappack + "/" + mappack + num.str() + ".txt";
$
Oh, and it seems fireportal() should return void, not int (since you never actually return anything, nor use the return value). The graphics are really messed up under Linux (perhaps you use extended ASCII characters or something). See attached image. I broke down and ran the Windows executable, but once I had, I can understand what the symbols mean, sort of, and play the Linux version. ![]() Anyway, I must say I'm very impressed by this program! If you want me to port a version to Linux, I'd be happy to. Just give me a shout.Also, some minor suggestions:
I look forward to the implementation of portals. ![]() [edit] I should mention that the output looks much more palatable on full-screen terminals (which seem to support extended ASCII characters), but I can't really take a screenshot of that. [/edit]
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort Last edited by dwks; 06-19-2009 at 11:22 AM. |
| dwks is offline | |
| | #5 |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 10,355
| Moved to Projects and Job Recruitment forum.
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way |
| laserlight is online now | |
| | #6 | ||||||
| Registered User Join Date: Feb 2008 Location: Lehi, UT
Posts: 179
| Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
But I definitely want to get in touch with you. You helped so much with Alleytris.
__________________ Type-ins are back! Visit Cymon's Games at http://www.cymonsgames.com for a new game every week! | ||||||
| guesst is offline | |
| | #7 | ||||
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| Quote:
Unfortunately in this case the flag looks like -Wno-conversion, which warns you about other stuff too. Oh well. Never mind. Quote:
See below.Quote:
![]() Quote:
![]() Just send me a PM if you want code written/refactored/ported/criticized/whatever. I might make maps too if asked nicely! Anyway, as my first official task, I've attached an archive containing compiled 32- and 64-bit linux executables. (I hope you're grateful for the 32-bit one; I had to install ncurses on my chroot, an extremely laborious process which took at least twenty five seconds. </sarcasm>) Also, there are a few more warnings caught by my chroot compiler . . . . Code: $ g++ main.cpp -o asciiportal -lncurses main.cpp: In function 'XY rotchar(int, XY, XY, XY)': main.cpp:75: warning: converting to 'int' from 'double' main.cpp:76: warning: converting to 'int' from 'double' main.cpp: In function 'int hitswall(double, double)': main.cpp:149: warning: passing 'double' for argument 1 to 'typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::reference std::vector<_Tp, _Alloc>::operator[](size_t) [with _Tp = std::vector<int, std::allocator<int> >, _Alloc = std::allocator<std::vector<int, std::allocator<int> > >]' main.cpp:149: warning: passing 'double' for argument 1 to 'typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::reference std::vector<_Tp, _Alloc>::operator[](size_t) [with _Tp = int, _Alloc = std::allocator<int>]' main.cpp:157: warning: passing 'double' for argument 1 to 'typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::reference std::vector<_Tp, _Alloc>::operator[](size_t) [with _Tp = std::vector<int, std::allocator<int> >, _Alloc = std::allocator<std::vector<int, std::allocator<int> > >]' main.cpp:157: warning: passing 'double' for argument 1 to 'typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::reference std::vector<_Tp, _Alloc>::operator[](size_t) [with _Tp = int, _Alloc = std::allocator<int>]' main.cpp: In function 'void play()': main.cpp:505: warning: passing 'double' for argument 1 to 'int napms(int)' dwk@cypress:~/c$ g++ -W -Wall -ansi -pedantic main.cpp -o asciiportal -lncurses main.cpp: In function 'XY rotchar(int, XY, XY, XY)': main.cpp:75: warning: converting to 'int' from 'double' main.cpp:76: warning: converting to 'int' from 'double' main.cpp: In function 'int hitswall(double, double)': main.cpp:149: warning: passing 'double' for argument 1 to 'typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::reference std::vector<_Tp, _Alloc>::operator[](size_t) [with _Tp = std::vector<int, std::allocator<int> >, _Alloc = std::allocator<std::vector<int, std::allocator<int> > >]' main.cpp:149: warning: passing 'double' for argument 1 to 'typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::reference std::vector<_Tp, _Alloc>::operator[](size_t) [with _Tp = int, _Alloc = std::allocator<int>]' main.cpp:157: warning: passing 'double' for argument 1 to 'typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::reference std::vector<_Tp, _Alloc>::operator[](size_t) [with _Tp = std::vector<int, std::allocator<int> >, _Alloc = std::allocator<std::vector<int, std::allocator<int> > >]' main.cpp:157: warning: passing 'double' for argument 1 to 'typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::reference std::vector<_Tp, _Alloc>::operator[](size_t) [with _Tp = int, _Alloc = std::allocator<int>]' main.cpp: In function 'int hitsobj(int, double, double)': main.cpp:163: warning: comparison between signed and unsigned integer expressions main.cpp: In function 'int still_alive(int)': main.cpp:172: warning: comparison between signed and unsigned integer expressions main.cpp: In function 'void draw_screen(int)': main.cpp:193: warning: comparison between signed and unsigned integer expressions main.cpp:194: warning: comparison between signed and unsigned integer expressions main.cpp: In function 'void fireportal(int, int)': main.cpp:233: warning: comparison between signed and unsigned integer expressions main.cpp: In function 'int move_objects()': main.cpp:334: warning: comparison between signed and unsigned integer expressions main.cpp:335: warning: comparison between signed and unsigned integer expressions main.cpp:337: warning: comparison between signed and unsigned integer expressions main.cpp: In function 'void play()': main.cpp:505: warning: passing 'double' for argument 1 to 'int napms(int)' $ Talk to you later!
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort | ||||
| dwks is offline | |
| | #8 |
| Registered User Join Date: Feb 2008 Location: Lehi, UT
Posts: 179
| Hey, DWKS, or anyone else, how well does SDL code mix with Linux? Does it remain pretty cross compatible? Are there any special considerations I need to be aware of? Portals are implemented, in fact all features I want are implemented. However, in nailing down bugs I ended up breaking and rewriting swaths of the code. What I've rewritten is much easier to follow, which is good because _I_ was getting lost. If you'd like to see an earlier build that had portals implemented, check it out: Bytejacker - The Gamerdrome - ASCIIpOrtal Update 2 DWKS, I'll be contacting you with the updated code tonight.
__________________ Type-ins are back! Visit Cymon's Games at http://www.cymonsgames.com for a new game every week! |
| guesst is offline | |
| | #9 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| SDL code mixes really well with Linux. And you don't have to put any platform-specific code in at all (though you sometimes do for Windows, depending on your compiler). As I mentioned in my email to you, I'm pretty busy right now but I'll definitely have a look at this by Thursday, perhaps even tomorrow if I can.
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort |
| dwks is offline | |
| | #10 |
| Woof, woof! Join Date: Mar 2007 Location: Australia
Posts: 3,139
| I would suggest abstracting SDL also, since you'll only ever use a handful of SDL stuff. It means that when you want to change frameworks, you can very easily. Although I tend to use, SDL just for input/windowing & texture loading. Then OpenGL for drawing, and FTGL for fonts. It's certainly true that SDL is a "Jack of all trades, master of none". |
| zacs7 is offline | |
| | #11 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,381
| You're going to abstract an abstraction layer?
__________________ "Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot |
| brewbuck is offline | |
| | #12 |
| Hail to the king, baby. Join Date: Oct 2008 Location: Faroe Islands
Posts: 713
| that's done all the time... I guess people just get complicated about making something simple... |
| Akkernight is offline | |
| | #13 |
| Frequently Quite Prolix Join Date: Apr 2005 Location: Canada
Posts: 7,629
| I do that all of the time . . . nearly all of my SDL projects have a wrapper around it. Some of them are good ones which let me drop in other libraries like the SGE instead of SDL_gfx (i.e., xuni and mundus's wrappers). Some of them are really simplistic 200-line ones (like collision's). It makes your life easier, especially if you decide to use a different library at some point. (I especially like writing nice wrappers for XML libraries. xuni originally used expat but I easily added minixml support; callis originally used minixml until I got tired of it and wrote my own XML parser instead. )Anyway, contrary to my assertion, I did have a look at ASCIIp0rtal today. I made a few changes, compiled it on Linux, and spent a rather long time playing it. I've attached a git diff log (read it from bottom up), a full diff of my changes, a compiled 64-bit executable, a compiled 32-bit executable, and a program of mine you may be interested in.I didn't attach the full updated code with the git repository, since I'm not sure if you want the code to be public yet. I did however email this to you. Anyway, here's the contents of the file dwk-notes.txt. It doesn't cover everything I did, but it's a good place to start. - Consider open sourcing ASCIIp0rtal. Seriously. See below. - I don't like spaces in file names . . . but if you do then that's fine. - Consider word-wrapping the help documents (probably to 80 characters). If you want this but don't feel like doing it, I could run the "fmt" Linux command on them which word-wraps automatically. Changes I've made to the code: - You had a #ifdef LINUX wrapper around the "\\" code, and I'm assuming you intended to change it to a "/" but never got around to it. Anyway, I addedplatform.h with a DIR_SEP definition which is either "/" or "\\" depending on the platform. It's easier to check for Windows and default to "/", since Windows has a standard define (WIN32) and UNIX, Linux, and Mac all work with "/". I admit to using string literal concatenation in main()'s help message. ![]() Broader suggestions: - Create map "scenarios". So if you ask ASCIIp0rtal to run the "original" scenario, it would open maps/original001.txt, then maps/original002.txt, etc. This makes it even easier for other people to create maps. (You could even scan the maps/ directory to see which scenarios there are.) Anyway, about open source -- I really really hope you're planning to make this open source. Because if you are then I'll probably contribute even more to it. I was thinking of using my 2D SDL game engine, callis, to write an image-graphical interface for it. I like it that much. I probably wouldn't do this if it wasn't open source though. I don't mind if you want to keep it sequestered from the world until making a 1.0.0 release with a bang -- that's fine as long as it's open source in the end. I wouldn't think you'd mind, since the code for most of your programs seems to be posted on your website -- but I thought I'd put in the request anyway.So . . . yeah. A description of the attached/mentioned files: - diff-2.txt: diff with log messages (read from bottom to top) - diff-2-full.txt: full diff; your beta1 version to my final modified version - beta1-dwk-2-binary.zip (get rid of the .txt): Linux 32-bit (Debian stable) and Linux 64-bit (Debian testing) executables (normal, neither stripped nor debug ones) - quaeris.zip: the very beginnings of a rogue-like I wrote in ncurses three years ago. Not too interesting, but I thought you might be interested in its line-of-sight code. Can't even remember how I did it, but I know I got the algorithm from Dungeondweller - www.roguelikedevelopment.org. Fantastic site, that. - and see your email for the full source archive. [It seems that quaeris.zip is too big to attach -- I've uploaded it to here: http://dwks.theprogrammingsite.com/m...wn/quaeris.zip "quaeris", by the way, is Latin for "you seek"; since it was supposed to be a role-playing game, I thought the name appropriate.] As you'll see, I really didn't change the [ASCIIp0rtal] code much. I didn't look too closely at it this time. I did note however that you could make use of temporary variables to make some lines shorter. Oh, and if you wanted to foray into object-oriented programming you could try to create a method which would determine whether a point lay within a bounding box, and other operations like that which you use a few times.Keep up the great work! ![]() -- DWK
__________________ dwk Seek and ye shall find. quaere et invenies. "Simplicity does not precede complexity, but follows it." -- Alan Perlis "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra "The only real mistake is the one from which we learn nothing." -- John Powell Other boards: DaniWeb, TPS Unofficial Wiki FAQ: cpwiki.sf.net My website: http://dwks.theprogrammingsite.com/ Projects: codeform, xuni, atlantis, etc. New project: nort |
| dwks is offline | |
| | #14 |
| Registered User Join Date: Feb 2008 Location: Lehi, UT
Posts: 179
| The only reason I don't want to release the sourcecode of the current build publicly is I don't want folks getting frustrated with the lack of user-friendlyness in the game because it's unfinished. But when I finally release 1.0 I will include the source and, if you all would like I'll make a note of it here. Tho it seems DWKS is the only one that's interested. I wonder why it's necessary to include a whole new header for compatibility when it'll only affect a single line? Seems like using a flamethrower to light a cigarette. Okay, maybe not that extreme, but still. As for abstracting the SDL properties... I'm probably not going to worry about that since every platform I'd like to develop for use the same SDL functions.
__________________ Type-ins are back! Visit Cymon's Games at http://www.cymonsgames.com for a new game every week! |
| guesst is offline | |
| | #15 |
| Registered User Join Date: Jan 2008
Posts: 575
| Actually, I think it is pretty cute and looks very playable, but until you have a version with actual portals I don't see a reason to comment. Soma |
| phantomotap is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Your biggest project: how many lines have you written? | happyclown | General Discussions | 44 | 04-29-2009 07:30 AM |
| 2D RPG Online Game Project. 30% Complete. To be released and marketed. | drallstars | Projects and Job Recruitment | 2 | 10-28-2006 12:48 AM |
| Dynamic Binding | gpr1me | C++ Programming | 1 | 03-24-2006 09:01 AM |
| MFC in an empty project | cunnus88 | Windows Programming | 0 | 10-09-2005 09:19 AM |
| Game Independent Anti-cheat Project Needs Programmers | GIA Project Lea | Projects and Job Recruitment | 3 | 09-15-2005 07:41 PM |