• Content count

  • Joined

  • Last visited

Community Reputation

201 Neutral

About EyeSize

  • Rank
  1. Hi ILoveJesus,   I am currently working on 3D world generation (but it also applies for 2D i guess). I personaly only want to generate cities but not the less. What I do is is the following: 1) Generate the world itself (just a simple world with some mountains) 2) Randomly select locations I would like to place a city (random numbers basically).  3) Verify if there location I selected isn't 2 rough (checking 'x' locations around my selected location) 4) Generate a city layout 5) Encase the border of the city with mountains (with another bit of random generation magic) 6) Override world data for that part of the map 7) Generate accesspaths   You could do the same with 2d generation just generate a location for the dungeon surround the location with mountains and if it is a low level dungeon generate access paths if it's a high level dungeon don't generate.   Hope this helps, With kind regards,   StaticCube
  2. How is my programming format

    Hi Cdrandin,   First of all let me tell you I don't program unity but do program python, c#, c++, etc. Looking at the format I personally think it looks really clean. Only thing I would change myself (if possible) is put the description of the function above the function. Also I am missing a simple outline for the class (meaning a bit of comments explaining what this class is for).   As for the rest of the code I think it looks pretty nice.   With kind regards,   StaticCUbe
  3. rendering

    Correct :) best of both worlds imho
  4. rendering

    Well it is possible but for 2D I would really suggest Slick2D. The reason comes from there site to be honest ;): Slick2D is an easy to use set of tools and utilites wrapped around LWJGL OpenGL bindings to make 2D Java game development easier.
  5. rendering

    Hi,   I personally use lwjgl for 3D rendering in java and Slick2D for rendering 2D.    For both libraries there are a few tutorials on the website of lwjgl: http://lwjgl.org/wiki/index.php?title=Main_Page#Getting_started. I personally used this tutorials and must say after doing a few of them I understoot how rendering works (at least with this library). The code is pretty clean so it should be fairly simple to see what is going on.   With kind regards,   StaticCube
  6. Hi Everyone,   So I have been working on a game mainly just for fun but it appears I am a bit stuck. It's mainly a design issue. First let me tell you a bit about the game and what I am trying to achieve. I am working on a game written in java. Mainly for the portability. The main focus of the game is to make a game that is extendable / moddable by a lot of users (not only programmers but also non-programmers).   The bit I am stuck in is that I would like to dynamically generate a world. The world will be voxel based (for those that do not know this is the same way worlds in minecraft look). The world consists of blocks which are either loaded from a txt file (or something similair) or compiled java class files (for the more advanced stuff).   Main Question So now for the question :). The problem I am facing is how to set this up. The world generation part isn't really the problem but mainly how to create the list off all available blocks.    I personally was thinking the following. Have 1 class called BlockBlueprint which contains information both of the block types use (meaning the txt one and the class one). The BlockBlueprint would contain information like: name, minOccurenceLevel, maxOccurenceLevel, frequency, textureFile, textureCoords, etc. Then fill this information for each block type creating a list with blockBlueprints (which in it's turn can be used in world generation).    Then have a second class called BlockFactory which requires a blueprint. This factory would either invoke the BlockTxtLoader or BlockClassLoader to actually create the block (for the world). I am not quite sure what to return from both loaders (a superclass maybe with default functions, or a class which implements an interface).   What would be the best (or another way) of approaching this? Would you use a (blueprint / template / type) like class or...? Also would you use a superclass or interface?   Side Question Also as my game always runs in Server / Client mode (server hosts world and client only displays world). I would probally need to send all classes over the network to the client and have a similar setup client side. Or are there any other alternatives i should consider?   With kind regards,   StaticCube
  7. Best language to start programming?

    Well both java and gamemaker are good for making games. I personaly do a lot of java at the moment combined with lwjgl (which i probally typed wrong as i always do). For 2D i do recommend using Slick2D.   As for gamemaker I personaly think its kind of limited but is good for making a draft of your game.   I myself used python. It's pretty easy to learn and combined with pygame you can have a lot of fun :).   Just my 2 pence.   With kind regards,   StaticCube
  8. Not sure where to start

    What I did when I first started out was to think of a few simple games I like (like pong or snake) and then write down the elements I like most.   For example instead of making a direct copy of snake or tetris you could have a snake which you can use to form shapes then when pressing a button have the snake drop down like a tetris block. Its not really about the complexity of games but more about having fun and creating unique gameplay. Which I personally think is most important.   With kind regards,   StaticCube
  9. Game Development
  10. [C++] Enums

    Hi Antheus, I must say you address an interesting problem here. The structs and enums are indeed used for network transmition (and luckely the server is also written by us). This means we always know what data is being send and what the maximum size of an enumeration is. When the output of the server changes the API changes (meaning our clients are forced to update there application). As for your example I like the fact that it is possible to actually iterate through the enumeration. I saw you implemented it as an integer but I can see how we can implemented as an enumeration. I will have a better look at it because its looks good. With kind regards, EyeSize
  11. [C++] Enums

    Hi again, I tried the solution provided by mattd earlier but I get an error (As shown in the text below). I have created a simple project (as shown in the source box below). **** Internal Builder is used for build **** g++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\TestProject.o ..\src\TestProject.cpp ..\src\TestProject.cpp:47: error: use of enum `iOpStartLights' without previous declaration ..\src\TestProject.cpp:47: error: expected unqualified-id before '{' token ..\src\TestProject.cpp: In function `int main()': ..\src\TestProject.cpp:63: error: `iOpStartLights' was not declared in this scope ..\src\TestProject.cpp:63: warning: unused variable 'iOpStartLights' Build error occurred, build is stopped Time consumed: 297 ms. #include <iostream> using namespace std; #ifdef _MSC_VER #define COMPILER_MSVC #endif #ifdef __GNUC__ #define COMPILER_GCC #endif #ifdef _WIN32 #define PLATFORM_WINDOWS #endif #ifdef _WIN64 #define PLATFORM_WINDOWS #endif #ifndef PLATFORM_WINDOWS #define PLATFORM_LINUX #endif #if defined(COMPILER_MSVC) #define PACKED_ENUM(e) enum e : unsigned char #elif defined(COMPILER_GCC) #define PACKED_ENUM(e) enum __attribute__((__packed__)) e #else // Fallback - don't use packed enums #define PACKED_ENUM(e) enum e #endif PACKED_ENUM(iOpStartLights) { STARTLIGHT_NOTSET = 0, STARTLIGHT_CONFIG_0 = 1, STARTLIGHT_CONFIG_1 = 2, STARTLIGHT_CONFIG_2 = 3, STARTLIGHT_CONFIG_3 = 4, STARTLIGHT_CONFIG_4 = 5, STARTLIGHT_CONFIG_5 = 6, STARTLIGHT_CONFIG_6 = 7, STARTLIGHT_CONFIG_7 = 8, STARTLIGHT_RESET_CONFIG = 20, STARTLIGHT_FORCE_START = 21, STARTLIGHT_MAX, }; int main() { cout << sizeof(iOpStartLights) << endl; cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! return 0; } When i try to define (see below) it gives an error: enum __attribute__((__packed__)) myEnumOld { NUMBER1 = 0, NUMBER2 = 1, NUMBER3 = 2, }; Errors: ..\src\TestProject.cpp:13: error: use of enum `myEnumOld' without previous declaration ..\src\TestProject.cpp:13: error: expected unqualified-id before '{' token When I define it as (see below) it all works oke: enum myEnum { NUMBER1 = 0, NUMBER2 = 1, NUMBER3 = 2, }__attribute__((__packed__)); Any ideas on why it does this ? @Ozak I know it's hell for the moment (especially because it needs to stay compatible with Visual Studio). I also have 2 installs off gcc (first one on ubuntu version 4.something second on windows version 3.4.5 (which is even worse). With Kind Regards, EyeSize [Edited by - EyeSize on February 17, 2010 4:27:18 AM]
  12. [C++] Enums

    Hi mattd, Thank you for your reply. Some enums need to be packed because they are send over the internet. There are about 20 data packages each second so we would like to keep the size of each package as small as possible. I like your way of doing the enum as is makes it all a bit more readable. I'll try your solution thanks, With kind regards, EyeSize
  13. [C++] Enums

    Here you go : Platform.h (Defined in the Core Project (which is just a library of shared source)) #ifndef PLATFORM_H #define PLATFORM_H #ifdef _MSC_VER #define COMPILER_MSVC #endif #ifdef __GNUC__ #define COMPILER_GCC #endif #ifdef _WIN32 #define PLATFORM_WINDOWS #endif #ifdef _WIN64 #define PLATFORM_WINDOWS #endif #ifndef PLATFORM_WINDOWS #define PLATFORM_LINUX #endif #ifdef COMPILER_MSVC #define ENUM8PRE #define ENUM8POST : unsigned char #else #define ENUM8PRE __attribute__((__packed__)) #define ENUM8POST #endif #endif //PLATFORM_H enumdefs.h (resides in the shared folder and is not inside any of the projects (because it only contains header files) #ifndef IOP_STDDEFS_HPP #define IOP_STDDEFS_HPP #include "../library/platform/platform.h" enum ENUM8PRE eTiming ENUM8POST { TIMING_NOTSET = 0, TIMING_EXPECTED_STREAMSTART = 1, TIMING_EXPECTED_STREAMSTOP = 2, TIMING_EXPECTED_RACESTART = 3, TIMING_EXPECTED_RACESTOP = 4, TIMING_DEFINITE_STREAMSTART = 5, TIMING_DEFINITE_STREAMSTOP = 6, TIMING_DEFINITE_RACESTART = 7, TIMING_DEFINITE_RACESTOP = 8, TIMING_TYPE_MAX = 16, }; enum ENUM8PRE eStartLights ENUM8POST { STARTLIGHT_NOTSET = 0, STARTLIGHT_CONFIG_0 = 1, STARTLIGHT_CONFIG_1 = 2, STARTLIGHT_CONFIG_2 = 3, STARTLIGHT_CONFIG_3 = 4, STARTLIGHT_CONFIG_4 = 5, STARTLIGHT_CONFIG_5 = 6, STARTLIGHT_CONFIG_6 = 7, STARTLIGHT_CONFIG_7 = 8, //... STARTLIGHT_RESET_CONFIG = 20, STARTLIGHT_FORCE_START = 21, STARTLIGHT_MAX, }; #endif kernelinfo.h (Inside the API project) #ifndef KERNELINFO_HPP #define KERNELINFO_HPP #include "library/network/ip4address.h" #include "shared/iopenerdefs.h" namespace MyNamespace { /** Some 'global' information, needed by several subsystems */ struct KernelSettings { eTiming m_expected ; char m_datafilename[512]; StreamAddress m_serverAddress; unsigned short m_flags; char reserved[30]; KernelSettings() { m_expected = TIMING_EXPECTED_STREAMSTART; m_flags = 0; } } } #endif [Edited by - EyeSize on February 17, 2010 4:05:16 AM]
  14. Hi all, At the moment I am working on a project written in Visual Studio 2008 (2005 compatible). I am trying to convert this project to an eclipse CDT project (in combination with GCC) (because I want to have a project that is also compilable on Linux / Mac / XBox / PS3 / etc). The existing project contains 2 types of enums: enum myEnum enum myEnum : unsigned int The second enum declaration is not working in GCC (which is normal because it's a Visual Studio definition). I have created the following declaration to keep the project compatible with visual studio: #ifdef COMPILER_MSVC #define ENUM8PRE #define ENUM8POST : unsigned char #else #define ENUM8PRE __attribute__((__packed__)) #define ENUM8POST #endif I then define my enums as following: enum ENUM8PRE myEnum ENUM8POST When i create a single file (as a test project) this works like a charm. But when I add it to the main project (which consists of 2 seperate libraries) I get a lot of 'does not name a type', 'was not declared in this scope' and 'has not been declared' errors. The anscii drawing below shows the project setup: | - API | - myClass.cpp (includes platform.h && myenums.h) | - Core | - platform[/indent] | - platform.h[/indent][/indent] | - Shared | - myenums.h Any ideas on why the project is giving so much errors about enums not being defined With kind regards, EyeSize [Edited by - EyeSize on February 17, 2010 4:41:39 AM]
  15. What is the best way of doing this

    Hi all, Thanks for all of your replies. @Shakedown: thanks for your advice about the gui package. I will definitly look into this. I hope it helps me create my own gui (in game) or if all else fails i could implement there gui. @Kalten: When I say clear the buffer I use the (direct3ddevice)->clear(Some Stuff here) function. As for the bypassing I do have a function to see if I am in the main menu or in game. When I am in game the render object is passed a few sprites and stuff when its in game it is passed some 3D objects. With kind regards, EyeSize