Eber Kain

Members
  • Content count

    375
  • Joined

  • Last visited

Community Reputation

130 Neutral

About Eber Kain

  • Rank
    Member
  1. My Progress Thread

    Yeah, for me, if it were offline then I wouldn't bother. :) Update 2: Coordination Well, I wrote a camera class, which when considering the games requirements, all I needed was control over the render orgion point. It was easy to write the class, which turned out to be buggy as all hell since its the first thing I've done in a long time. I worked on bugstomping till the wee hours and finally gave up, took me two minutes to look at it this morning and figure out what my problem was. I was artifically imposing a limit on the rotation of one axis, but it was always outside that limit cause I wasn't initilizing the variables. Thats what I get for retasking variable names in the middle of coding. The next task is to create some dummy instances of my icon interface object, get them to bind to the planets surface, should be easy knowing the planets exact radius, and then they still have to be clickable. Well, I can see that there is a problem right away cause the icon class is only setup for 2d space. Luckally I had some foresight when I wrote this and made a simple type system so I can just inherit sInterfaceIcon as a base type and still use the new sWorldIcon class in all the existing processing routines for picking and whatnot. Looks like multiple constructors are in order for the sWorldIcon class, since planets are only going to ever need two rotations and a single offset, whereas other modes may need 3 offsets and no rotation. Well, its all working except for picking, which is something I didn't really think about before I started. My icon picking system is a pure 2d cursor vs bounding box routine. I am going to implement a 3d picking system later on, but I think that would be overkill for this. Luckally, I wrote a routine to get the screen coords from 3d space back when I did the render engine basecode. Well, most of the parts are in place now to implement the planet interface, I guess I need to go back and do some more brainstorming and make prototypes for the different interface screen. Oh, and there are still a bunch of blanks in the SRS to fill in. (to be continued)
  2. Well, this seems like a good idea for me, since I'm doing this project solo it will help to give me someone to talk to that can actually relate to what I'm talking about. Basically, I'm going to post info as I work on the project about what I'm trying to do and whats giving me problems. It will be alot of technical stuff, so I believe this is the right forum for it. You do not have to participate, but any discussion or point you want to bring up will be, at the very least, read. Update 1: Resurrection I picked up Galactic Civilizations 2 a couple weeks ago and it sparked my intrest in a space conquest game again, but the 4X game I want to play doesn't exist. So I gave it a week and I still have the fever to play a great 4x game, and I have a half completed SRS that details what I want from the game's content, so Its time to dig out some code. The last programming project I worked on was a 4X game, and though my steam ran out before getting to any part of the game content, I did have the interface and rendering engine up and working. Well, Its been a year since I even programmed a single statement of code, I'm suprized at how much I've retained. At this point I've got the project compiling and running, had to fix alot of little problems like linking the right .libs, which took some head scratching. Hmmm... Getting an assertion error now. Doh, trying to delete something that is already deleted. Had a heck of a time getting _CrtDumpMemoryLeaks to work in Express, prolly just my rust. Hmmm... The last thing I was working on was rendering a planet, its got the texture, but all green. OpenGL is so picky, picky, picky, have to reset the color to white before drawing. Forgot I did this whole thing in OOP, I have a dynamically allocated <list> of LoadObjects called LoadList that has its pointer shared to all engine componets, and everythign that needs to be loaded inherits LoadObject and sets the type of object it is in the parent constructor. A function in the main module pulls objects off the LoadList and switches the Type parameter, then typecasts the LoadObject as the real class type and passes it to the proper loading function. A good thing I go overboard with comments cause I didn't even change anythign and it took me an hour to figure out how that was supposed to work. :) Hmmm... My planet is rendered properly, in the center and taking most of the screen, but based on my prototype screenshot I am going to be binding alot of icons to the planets surface and I have a bunch of translates and whatnot before drawing the planet to get it in the right spot... Before I can even worry about that I need to add some mouse interaction so I can spin the planet around by grabbing the screen. That sounds like a good thing to work on next... after I fix all these size_t to unsigned int conversion warnings that make no damn sense. (to be continued)
  3. Staying Motivated

    I've tried to work in groups with other programmers online and when I was in college, it has never been a rewarding or successfull experience. Finding someone around the same skill level with compatiable ideas on a project is no small feat, plus I'm pretty stubborn....
  4. This is not really a programming specific question as such. My problem is, following through on a project. I can't even count the number of programs I've started and dropped before finishing. Provided you have finished a game project, can you offer some advice on how to actually get to the end? I found myself writing a new design doc this morning and then I just stopped because I know I wont get to the end of it... :/
  5. That is very similiar to what I have been working with as my engine design. A set of foundation objects that allow specific objects to be deligated in groups to the proper engine module. I have managed it by giving each foundation object a protected 'type' variable, initilizing the variable in the constructor of the inheriting class. I pass the object around as a pointer to the base class, and then typecast it back based on what the type variable contains. It is a good bit more complex than the typical linear program, but I feel that the design will offer greater flexability at the expense of efficiency.
  6. How to "finish" a freeform game

    What you do is make some boss monsters that you dont think can be beat, and then tell the player, in the context of the game, that they win if they beat those bosses.
  7. Quote:Original post by Wavinator Park a unit in the center of an area, and it's as if you've covered the whole area. Mid and late game RTS and 4X empire games often stagger under the weight of tons of units. Many for this reason implement direct unit caps or other overt mechanisms (like exponential prices) to prevent you from blanketing an areas. Yet you often need to cover a wide area. So without resorting to unit automation (patrol routes or whatever), what about letting a single unit symbolize multiple units covering that wide area? Here's an example: You want a battalion of tanks to guard a ridge. Instead of clicking each one, one tank acts as a symbol for many others and some sort of graphic denotes that the battalion covers a certain shape. The original graphic for the tank shows up in the center of the line, square, oval or whatever that marks the coverage area. What options would you need both to build, to defend, and to attack under such a concept? Should there be a deployment delay, a decrease in defensive power, or other such tradeoffs? Alot of games have used this mechanic, and I cant really think of any where I actually liked it. If there are 1000 soldiers in that division, I want to see 1000, not 10. I think that some game mechanics can be put in place that will prevent the problem you are looking to solve, but it all boils down to what you want. What I plan on looking into with my 4X game is having each ship be more individual and important, every ship the player comissions will stay in service for a long time, but will also take a long time to construct (say, 30 years in service and 2 to build), Provided your shipyard can can only construct one ship at a time, that limits you to a maximum of 15 or so vessels, with half of them underpowered compared to the advancing technologies, and a couple in the refit yard for upgrades. Considering the massive ammount of resources required for a single starship, you are not going to be able to supply a bunch of shipyards in one location, so they have to be distrubited with your expansion and themselves cost a fortune in time and materials to construct. The whole point here it to develop a realistic and plausable system where the size of the players fleet is relative to the size of their empire, and they dont have the problem of planethopping fleets. Thouhg I think im way off point by now. :)
  8. Thats a handly little function, thanks. After some investigation I found that it is all from local instances of ifstream and string. Not much I can do about it. Some of them even appear to be inside or before the _CrtSetDbgFlag(). Here is a super short program, that still has leaks. //============================================================================= // Memory Leak Tracking Stuff //============================================================================= #define _CRTDBG_MAP_ALLOC #include <stdlib.h> #include <crtdbg.h> #define meMalloc(s) _malloc_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__) #define meCalloc(c, s) _calloc_dbg(c, s, _NORMAL_BLOCK, __FILE__, __LINE__) #define meRealloc(p, s) _realloc_dbg(p, s, _NORMAL_BLOCK, __FILE__, __LINE__) #define meExpand(p, s) _expand_dbg(p, s, _NORMAL_BLOCK, __FILE__, __LINE__) #define meFree(p) _free_dbg(p, _NORMAL_BLOCK) #define meMemSize(p) _msize_dbg(p, _NORMAL_BLOCK) #define meNew new(_NORMAL_BLOCK, __FILE__, __LINE__) #define meDelete delete //============================================================================= //Local Headers //============================================================================= #include <string> #include <fstream> using namespace std; void main(void) { //track memory leaks _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); _CrtSetBreakAlloc(41); //program code if(true) { ifstream file; string path = "testfile.txt"; file.open(path.c_str(), ifstream::in); file.close(); } //memory leak dump _CrtDumpMemoryLeaks(); } Detected memory leaks! Dumping objects -> c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {42} normal block at 0x00320820, 33 bytes long. Data: < C > 00 43 00 CD CD CD CD CD CD CD CD CD CD CD CD CD c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {41} normal block at 0x003207B8, 40 bytes long. Data: <4 F > 34 82 46 00 02 00 00 00 00 00 00 00 00 00 00 00 Object dump complete. The thread 0x844 has exited with code 1 (0x1). The program 'C:\Programming\4x\CodeTesting.exe' has exited with code 1 (0x1).
  9. Well, if I knew where I was leaking, then I could fix it, and I assume noone wants to wade through tens of thousands of lines of source code. Most of the time, those dumps link to my source code, but those dont. They just direct to this.. which is crtdbg.h and not my code. inline void* __cdecl operator new(unsigned int s) { return ::operator new(s, _NORMAL_BLOCK, __FILE__, __LINE__); } I was wondering if anyone had any ideas what I should look for, or other ways I can try to figure out where the leaks are at? Or are they even leaks in my program?
  10. Using the technique listed here http://www.flipcode.com/cgi-bin/fcarticles.cgi?show=63785 I have been able to keep tabs on the memory leaks in my program, but I still get some that just point me to the new operator its self. Im trying to figure out how to do this thing, but im not having much luck. Here is the dump I get from MSVC, i think this has to do with STL because I use alot of <list> <string> <map> structures in my code. The leaks I have here are not that bad, but I would like to get them all cleared up. Detected memory leaks! Dumping objects -> c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {783} normal block at 0x01B007B8, 12 bytes long. Data: < > B8 07 B0 01 B8 07 B0 01 CD CD CD CD c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {775} normal block at 0x01B00518, 12 bytes long. Data: < > 18 05 B0 01 18 05 B0 01 CD CD CD CD c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {767} normal block at 0x00BAC5D8, 12 bytes long. Data: < > D8 C5 BA 00 D8 C5 BA 00 CD CD CD CD c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {759} normal block at 0x00BABFE0, 12 bytes long. Data: < > E0 BF BA 00 E0 BF BA 00 CD CD CD CD {461} normal block at 0x00BAAFD8, 512 bytes long. Data: < > 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {449} normal block at 0x00BAADF0, 16 bytes long. Data: < K > A4 D4 4B 00 01 00 00 00 00 00 00 00 00 00 00 00 c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {87} normal block at 0x00BA3770, 33 bytes long. Data: < C > 00 43 00 CD CD CD CD CD CD CD CD CD CD CD CD CD c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {86} normal block at 0x00BA3708, 40 bytes long. Data: < K > F8 D3 4B 00 02 00 00 00 00 00 00 00 00 00 00 00 c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {41} normal block at 0x00BA07B8, 1 bytes long. Data: < > CD Object dump complete. Detected memory leaks! Dumping objects -> c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {783} normal block at 0x01B007B8, 12 bytes long. Data: < > B8 07 B0 01 B8 07 B0 01 CD CD CD CD c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {775} normal block at 0x01B00518, 12 bytes long. Data: < > 18 05 B0 01 18 05 B0 01 CD CD CD CD c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {767} normal block at 0x00BAC5D8, 12 bytes long. Data: < > D8 C5 BA 00 D8 C5 BA 00 CD CD CD CD c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {759} normal block at 0x00BABFE0, 12 bytes long. Data: < > E0 BF BA 00 E0 BF BA 00 CD CD CD CD c:\program files\microsoft visual studio\vc98\include\crtdbg.h(552) : {41} normal block at 0x00BA07B8, 1 bytes long. Data: < > CD Object dump complete. The thread 0xC48 has exited with code 0 (0x0). The program 'C:\Programming\4x\Client.exe' has exited with code 0 (0x0).
  11. 4X game inquiry

    Quote:Original post by Spoonbender Quote:Original post by Eber Kain How about one big map, a quazirealistic galaxy with literally, a million stars. You mean with a static galaxy? And where you can play non-stop for the next 32 years before you encounter another player? Yep, sounds fun. Almost as fun as watching Windows defragment the HDD. Honestly, I'd say ask yourself what would make a fun game. You're supposed to be the game designer, right? [wink] We'll be happy to provide feedback and add our ideas, but maybe you should start out deciding on the basic game you want to make. How did you like MOO 3, Space Empires IV or any of the other games in the genre? What worked and what didn't? You decide. [smile] I didn't necessarally mean static, but randomly generated as you explore. Let me give you some of my ideas for this game. The galaxy is divided into octants, here is the overall map I found and modified. This will essentally be the base map, and what layout I want to recreate in-game. Overall, the galaxy is divided into 'The Core' plus six 'Octants' identified by the Alpha, Omega labels. Each octant is again subdivided into regions based on the arms that pass through the octant. Our system, for example, is in the Delta Orion region. Each region will again by broken down into sectors based on the star density in that area, each sector will contain the actual star systems that are to scale and simulated as real star systems. The basic idea here, is a procedurally generated galaxy based on simple textures. If anyone has created a map for sim city 4, you will know what I am going for. Different version of the above map will be color coded to indicate the seperation of different parts of the galaxy. Alpha octant may be green, while Beta octant is red, the engine will read the color values and build the map based on that. I am developing the game in MSVC6 as a Win32 program, and I am using OpenGL for the graphics. So far I have only been working on the interface, but I have nearly completed all the different interface containers I need to run the game. I plan to write a simplified database engine to share among the main program and content creation support programs. I spent a day looking for a database engine that would fit my needs, but my search did not turn up anything useful. I am 100% certin I will be able to complete this file processing component in a short timeframe. Last night I finished the information panel control that allows me to display blocks of text and data statistics. It allows the players to flip pages and scroll to read text off the page. The icons system takes greyscale/alpha icons that are 64x64 and composts them onto a large image texture to minimize the number of texture binds required by the interface. Since the icons are greyscale, I can colorize them according to the current context of whatever the icon represents. The vision I have for the game is entirely story driven Macromanagement. I will create an enhanced text editor that writers will be able to use to create event trees. Every part of the game content will be controlled through these event trees, which are sort of like suped up dialogue trees. Whenever a low level scene is loaded, such as when you are focused on a planet. The scene is filled with icons representing different character entities, these are generally NPC's that control or govern the given city, research lab, shipyard, or whatever. Clicking on one of these character icons opens up an information panel that describes the character that the icon represents. Alongside the information panel will be a series of buttons that represent the beginning point of different event trees associated with this character. If for example, a character was the scientist in charge of a working research lab, you may have four different event trees named, Accelerate Research, Grant Funds, Direct Resources, Halt Research. Clicking on one of the actions will start the associated event tree. In game, event trees will essentally be dialogue sessions between you and an NPC, or some intermediarty. You will read the current nodes information and make a descision that leads to one of the children nodes. Event trees will have many ways to start, the most common will be through npc's, but they may also start at random, when new things are discovered, or the event may be applied to specific characters. Not all trees will run continiousally, that is to say, there will be time gaps between the stages of some nodes. Research for example, if you want to research something, you start the tree, navigate the nodes to specify what you want them to work on, the event tree's conclusion will be outstanding for a specified time interval, probably years in-game time. A system like this will give the game community expandability, and I think, will play perfectly for the exploration aspect of a 4X game. In the sense of Macromanagement, the player will not be able to say, "Research a Mk3 Plasma Rifle." you will be able to say, "Research plasma technology." But you will not have that level of control found in most games of the genre. This extends to combat and ship design, you will not be able to design starships by any means, you can establish design institutes and tell them to build a new ship designed to fill a role, you can even approve designs before they are in production, but you cant actually design the ship. I will be creating a procedural ship generator so all human ships will have visulizations. No alien civilizations will have visulizations since I plan on having thousands of civilizations in the galaxy all at once. You will not be able to control combat directly, you will be able to watch the combat play out from a tactical view, but the battle outcome will be entirely simulated on the opposed ships and crews. The game will be turn based, but instead of turns, there will be time intervals. So the player will be able to jump forward by an hour, day, week, month, or year. A realistic world scale is important to me, the player will start right after humans discover NLS engines (near-light-speed) and SL drives (slingshot). These early ships allow players to reach nearby starsystems and establish jump corridors for the SL drives to make the trip in a couple months. As a final note, ships will not travel in strait lines. :) That is the basic idea of the game I want to play, and am therefore making. I welcome any discussion.
  12. Win32 Question

    Quote:Original post by jflanglois ProgramMax is partly right. The big problem is your WM_SYSCOMMAND case. You can change it to: case WM_SYSCOMMAND: switch (*p_wparam) { case SC_SCREENSAVE: case SC_MONITORPOWER: return 0; default: DefWindowProc(*p_hwn, *p_msg, *p_wparam, *p_lparam); } return 0; and it should work. [edit] As an explanation, when you effectively intercept the WM_SYSCOMMAND message, you do not handle all the system commands apart from SC_SCREENSAVE and SC_MONITORPOWER, such as SC_MOVE. You need to pass those too DefWindowProc, thusly the default: section jfl. Excellent, that fixed it. Thanks a ton.
  13. Win32 Question

    Quote:Original post by ProgramMax Well there is at least one problem...your window proc is always calling default. It should be like this: switch( blah ) { case BLAH: // return a value... break; case FOO: // return a value... break; default: return DefaultWindowProc( ); } And if you really want to be cool: A lot of people think that functions should have one entry point and one exit point. So you could do: LRESULT blah; switch( ) { case FOO: blah = something; // what I would normally have returned default: blah = DefaultWindowProc( ); } return blah; I can step through the code with the debugger and I can tell that is is not calling the default window proc every pass. Whats the point in a return; followed by a break;? For the hell of it, I put the default function under the default case, but that still does not help fix my problem.
  14. Win32 Question

    Quote:Original post by jflanglois My guess is, from the info at hand: Change IDirectInputDevice8::SetCooperativeLevel to DISCL_BACKGROUND | DISCL_NONEXCLUSIVE [edit] Is cGameClient::ProcessIO a static member function? jfl. Im not using Directinput, nor do I have any DirectX SDK. [edit] no. If I make it static i got a ton of errors.
  15. Win32 Question

    Quote:Original post by ProgramMax What does the message handler look like? You may not be calling the default window proc and so the messages that you don't handle are never handled. LRESULT CALLBACK WindowProc(HWND p_hwn,UINT p_msg,WPARAM p_wparam,LPARAM p_lparam) { return GameClient->ProcessIO(&p_hwn, &p_msg, &p_wparam, &p_lparam); } LRESULT CALLBACK cGameClient::ProcessIO(HWND* p_hwn,UINT* p_msg,WPARAM* p_wparam,LPARAM* p_lparam) { switch(*p_msg) { case WM_ACTIVATE: if(!HIWORD(*p_wparam)) active = true; else active = false; return 0; case WM_SYSCOMMAND: switch (*p_wparam) { case SC_SCREENSAVE: case SC_MONITORPOWER: return 0; } return 0; case WM_KEYDOWN: keys[*p_wparam] = true; Keyboard((unsigned short)*p_wparam); return 0; case WM_KEYUP: keys[*p_wparam] = false; return 0; case WM_QUIT: case WM_CLOSE: running = false; return 0; } return DefWindowProc(*p_hwn, *p_msg, *p_wparam, *p_lparam); }