• Advertisement

EngineProgrammer

Member
  • Content count

    92
  • Joined

  • Last visited

Everything posted by EngineProgrammer

  1. Hi everyone! For the last 2 years I have been learning all basics of C++ Programming. Also I've tried to start writing a game engine but that didn't really worked out very well. ( It was a terrible framework you just want to kill when you look at it ) But now, after watching allot of open source engines and after looking at engine structures I'm going to restart with creating one. But I have some questions though. 1) I want to have my final engine with DirectX implemented, is it smart to start with a full Win32 code and then later on starting to implement Dx? 2) How long ( make a guess ) will it take to write a little engine ( incl. Basic: graphics, sounds, network, shaders, 3D models, 3D animation ) for an un-experienced Programmer? I'm guessing around 4-5 months but I think I'll be the only one who thinks it is that easy? [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] I already know the hardest thing won't be writing the code itself, but finding the best structure/framework. The structure of the engine I have in mind is this: WinMain func. -> Initializes Engine class + Game class Engine class -> Window class ( handles the window itself, fullscreen mode etc ) -> System class ( for input keyboard, mouse, controllers, etc ) -> Graphics class ( can load/create shaders, add effects ) -> Resources class ( to load images/sounds/videos ) -> Network class ( using RakNet ) I'm thinking to create a singleton design for each class above ( except the game class ).. Can't really think another way to make simple calls on them. I'll put some code down soon. Also, does someone have any tips for me I can use to create an efficient engine? Kind regards, Jonathan
  2. drawing in Win32

    Hey everyone, I'm just having some fun with reinventing many wheels. [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] I just love to understand the low level programming! So here is what I want to do: basically I want to make my own pixel drawing system. I want to create a pixel class which stores a color. After I make an array of [640][480] which will be my "screen". When I gave all pixels a color I want to draw every pixel on the screen. How can I draw all pixels on the screen? SetPixel is a very slow method so I want to avoid that. Is it possible to directly connect my pixels to the screen pixels? How does the GDI communicate with the screen pixels? How can I communicate with the screen pixels without using the GDI or SetPixel? Is it even possible? Kind regards, Jonathan
  3. OpenGL 3D algorithm

    Hey everyone, has been a while I've programmed but I'm back. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] I know that re-writing existing code is useless. But I don't mind to re-write some code, I want to learn how it's done. I want to make a 3D polygon and draw it in C++, without using DirectX or OpenGL. I've been looking around after source codes or tutorials but haven't found a single tutorial that helps me. Very simple example of what I want to do: [CODE] m_Polygon = new Polygon(vertex1, vertex2, vertex3, vertex4); // where the vertexes have a X,Y,Z m_Polygon->Draw(); [/CODE] So I want to draw the 3D polygon in my 2D screen. Can someone help me with this. [img]http://public.gamedev.net//public/style_emoticons/default/unsure.png[/img] Thank you and kind regards, Jonathan
  4. OpenGL 3D algorithm

    Thanks for the help, I've made a colorshader last year, but I didn't understood a single line of code what I was writing. Shaders are quite hard to understand for me. How does DirectX render his transformations? I just made a matrix class that can translate, scale and rotate. Tested it and it works. Don't mind how I use the methods. It's just a testing project. [CODE] Matrix matTranslate, matRotate, matScale, matWorld; matTranslate.SetAsTranslate(-0.7f, -0.4f); matRotate.SetAsRotate(80.0); matScale.SetAsScale(0.5,0.5); matWorld = matRotate * matScale * matTranslate; Matrix::SetAsWorld(hDC, matWorld); Rectangle(hDC, -1, -1, 1, 1); [/CODE] This is what I use for my transformations: [CODE] Matrix::Matrix(): eM11(0.0f), eM12(0.0f), eM13(0.0f), eM21(0.0f), eM22(0.0f), eM23(0.0f), eM31(0.0f), eM32(0.0f), eM33(0.0f) { } void Matrix::SetAsTranslate(float x, float y) { eM11 = 1.0f; eM12 = 0.0f; eM13 = 0.0f; eM21 = 0.0f; eM22 = 1.0f; eM23 = 0.0f; eM31 = x; eM32 = y; eM33 = 1.0f; } void Matrix::SetAsRotate(float radians) { eM11 = (float)cos(radians); eM12 = (float)sin(radians); eM13 = 0.0f; eM21 = (float)-sin(radians); eM22 = (float)cos(radians); eM23 = 0.0f; eM31 = 0.0f; eM32 = 0.0f; eM33 = 1.0f; } void Matrix::SetAsRotate(double degrees) { float radians = (float)(degrees/180 * M_PI); eM11 = (float)cos(radians); eM12 = (float)sin(radians); eM13 = 0.0f; eM21 = (float)-sin(radians); eM22 = (float)cos(radians); eM23 = 0.0f; eM31 = 0.0f; eM32 = 0.0f; eM33 = 1.0f; } void Matrix::SetAsScale(float x, float y) { eM11 = x; eM12 = 0.0f; eM13 = 0.0f; eM21 = 0.0f; eM22 = y; eM23 = 0.0f; eM31 = 0.0f; eM32 = 0.0f; eM33 = 1.0f; } Matrix operator*(const Matrix& ref1, const Matrix& ref2) { Matrix mat; mat.eM11 = ref1.eM11 * ref2.eM11 + ref1.eM12 * ref2.eM21 + ref1.eM13 * ref2.eM31; mat.eM12 = ref1.eM11 * ref2.eM12 + ref1.eM12 * ref2.eM22 + ref1.eM13 * ref2.eM32; mat.eM13 = ref1.eM11 * ref2.eM13 + ref1.eM12 * ref2.eM23 + ref1.eM13 * ref2.eM33; mat.eM21 = ref1.eM21 * ref2.eM11 + ref1.eM22 * ref2.eM21 + ref1.eM23 * ref2.eM31; mat.eM22 = ref1.eM21 * ref2.eM12 + ref1.eM22 * ref2.eM22 + ref1.eM23 * ref2.eM32; mat.eM23 = ref1.eM21 * ref2.eM13 + ref1.eM22 * ref2.eM23 + ref1.eM23 * ref2.eM33; mat.eM31 = ref1.eM31 * ref2.eM11 + ref1.eM32 * ref2.eM21 + ref1.eM33 * ref2.eM31; mat.eM32 = ref1.eM31 * ref2.eM12 + ref1.eM32 * ref2.eM22 + ref1.eM33 * ref2.eM32; mat.eM33 = ref1.eM31 * ref2.eM13 + ref1.eM32 * ref2.eM23 + ref1.eM33 * ref2.eM33; return mat; } void Matrix::SetAsWorld(HDC hDC, const Matrix& mat) { XFORM form; form.eM11 = mat.eM11; form.eM12 = mat.eM12; form.eM21 = mat.eM21; form.eM22 = mat.eM22; form.eDx = mat.eM31; form.eDy = mat.eM32; SetWorldTransform(hDC, &form); } [/CODE] The calculations I've written on paper first with help from a book. So I didn't copied anything from the internet. I'm getting the hang of matrices very fast with this book, next chapter is linear transformations! [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] But indeed, I'm using GDI and it's getting pretty classic. But I really don't want to use a single external library. Because it's too "easy" then.. [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] I'm not trying to be stubborn. Any suggestions how I avoid the classic functions? DirectX also must use a classic way or are they working very low level and code all their rendering themselves?
  5. OpenGL 3D algorithm

    I will gladly post my progress but it will take a while, today I realized I better learn matrices through 2D and when I understand everything I'll change to 3D. I'm making my own matrix class which will be supported with the function SetWorldTransform. This function works with XFORM but I'm not using this one. It's better to write my own calculations self so I can learn from it. When I got it all calculated I just put everything into an XFORM and transform the world. So when I understand the matrix and transform concept I go to 3D. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Or is there a better way to transform my object(rectangle, bitmap, etc)? I know matrices needs to be used to transform such an object, but I mean, is there something else to transform my world with?
  6. Viewports

    When looking at 3D projections and transformations I was thinking on 3Dsmax, which has multiple viewports. So I've tried to get my own viewport with logical units -1 to 1. Now I wonder if I'm using a modern way of setting up a viewport. I have found these functions on msdn but I have no idea if these are still used nowadays. [CODE] hDC = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &client); SetMapMode(hDC, MM_ANISOTROPIC); SetViewportOrgEx(hDC, client.right/2, client.bottom/2, 0); SetViewportExtEx(hDC, client.right, client.bottom, 0); SetWindowOrgEx(hDC, 0, 0 ,0); SetWindowExtEx(hDC, 2, 2, 0); Rectangle(hDC, 0, 0, 1, 1); EndPaint(hWnd, &ps); [/CODE] This code sets up my window to 2 logical units, from -1 to 1. So like DirectX uses his viewport. And I've changed the viewport extends so when I scale the window, the objects in the window are scaled also.
  7. 4D Arrays?

    4D "can" be visualized in 3D: [url="http://en.wikipedia.org/wiki/Tesseract"]http://en.wikipedia.org/wiki/Tesseract[/url] The fourth dimension can called whatever you like, some people say it's time, some people say it's space and some say it's an object in itself. Here is a nice link about how you project the 4D in 3D: [url="http://steve.hollasch.net/thesis/chapter4.html"]http://steve.hollasc...s/chapter4.html[/url] Four-dimensional geometry: [url="http://steve.hollasch.net/thesis/chapter2.html"]http://steve.hollasc...s/chapter2.html[/url]
  8. OpenGL 3D algorithm

    [quote name='Bacterius' timestamp='1354853787' post='5007989'] [quote]It's all learning purpose. You say that I first need to work with the CPU, how do I do that? How can I choose which one I can use to get my project running? I know the difference between both tho, cpu only does 1 thing at the time while a gpu does multiple things at the same time. But no idea when I'm using a cpu or a gpu.[/quote] If you're not sure, you're definitely using a CPU [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] You only "use" the GPU (at least the current generation) by programming little programs called shaders (in HLSL, or GLSL) which perform very specific tasks (e.g. transform vertices, or shade pixels). All the rest is done by the driver automatically. You don't actually write complete software on it. Everything that you code in C++ or C# or Java or whatever language, really, is done on your CPU. [/quote] Damn, I messed up my mind then. Thank you for clearing this out! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  9. OpenGL 3D algorithm

    Thanks everyone! Radikalizm, I'm not trying to make a commercial software renderer [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] DirectX and OpenGL can't be beaten so I won't try to. It's all learning purpose. You say that I first need to work with the CPU, how do I do that? How can I choose which one I can use to get my project running? I know the difference between both tho, cpu only does 1 thing at the time while a gpu does multiple things at the same time. But no idea when I'm using a cpu or a gpu. DracoLacertae, thanks for the examples! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] So drawing lines isn't that hard to get in 3D [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] Before I get on to it, I bought a math book which covers every mathematics what game programming concerns. So I hope to get a line or a 3D polygon on my screen today! uglybdavis, nicely done! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  10. OpenGL 3D algorithm

    I would like to write a small copy of DirectX.[img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] How do they handle the vertices and rendering of 3D models? How should it be handled for an optimal framework/engine? If my GPU can handle all the math, how can I render my 3D model with it? I still need to use some math from your first post or don't I? I'm looking up coordinate transformations and it's quite fun. [img]http://public.gamedev.net//public/style_emoticons/default/happy.png[/img] And how about particles? Like when I have 1 million particles. How should I best handle them? Do I need to do all calculations and rendering on the GPU? Or are there better/faster ways? You are helping me already but I'm still a bit confused about how it all works with the gpu / cpu thing. I want to get an optimal render system for low poly models with materials, shaders, lightning, bouncings, etc. I know the pipeline for the graphics rendering but I can't go any further than the first step at the moment. For example I want to be able to load a whole environment like COD with all players, bullets, effects in it. Kind regards, Jonathan
  11. [quote name='gooncorp' timestamp='1354616824' post='5007028'] heres a death information system im working on it will have even more data when we are through a lot of this data will be sent via xml to a website where the player stats are saved thanks for checking it out [media]http://www.youtube.com/watch?v=z-FVrIwb2CI&feature=youtu.be[/media] [/quote] Your intensity of the bounced lights is on 100%? Way too much even for metal. Try to make it changeable. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Have watched some video's and I must say, really good work! Keep it up!
  12. OpenGL 3D algorithm

    I'm looking up some information what GDI exactly is and this is a quote from wikipedia. [quote]Simple games that do not require fast graphics rendering use GDI. However, GDI is relatively hard to use for advanced animation, and lacks a notion for synchronizing with individual video frames in the video card, lacks hardware rasterization for 3D, etc. Modern games usually use DirectX or OpenGL instead, which let programmers exploit the features of modern hardware.[/quote] What makes DirectX a fast graphics renderer? How you decide the speed of rendering? I just want to get low-level what programming concerns. I really want to get the knowledge into my head how it's done. GDI only limited to 2D, how do I get the 3D in my program then? I'm assuming I need to calculate every pixel and draw them manually, please correct me if I'm wrong. I want to achieve real-time rendering. Dragging a 3D model into your window and be able to translate, scale and rotate in your project. But that is not for now, first the baby steps. But I can't do this alone sadly enough. Need some help from people who have experience in this because I can't find almost anything that helps me. maybe I'm not looking in the right place. [img]http://public.gamedev.net//public/style_emoticons/default/unsure.png[/img] Kind regards, Jonathan
  13. OpenGL 3D algorithm

    A billion percent thank you! In Win32 there are some standard functions for example: SetWorldTransform, SetGrapicsMode, etc. and structs like XFORM. Should I make any use of those functions and structs or should I rather make my own ones? Kind regards, Jonathan
  14. Humans Must Answer (2D space shooter)

    Wooooaaaah that looks awesome!! [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]
  15. Allocation of memory

    Hi everyone! I'm digging into open source engines to understand their memory management but the more I look in it, the more confused I get. For example Unigine ( it's a nice engine ) uses different headers for all kind of allocations. [CODE] struct FixedChunk; struct FixedAllocator; struct HeapChunk; struct HeapPool; struct HeapAllocator; struct SystemAllocator; struct Allocator; struct Memory; [/CODE] Why are they using so many structs(all in different headers)? An allocator is an allocator so why don't they just write 1 struct: Allocator. and use it for everything. I don't get it why they uses so many structs. So if someone could explain this for me, thank you! ~EngineProgrammer
  16. starting game engine

    [quote name='Radikalizm' timestamp='1349654444' post='4987804'] [quote name='EngineProgrammer' timestamp='1349653462' post='4987801'] Win32, DIrectX, OpenGL: Win32 is the standard library of C++. It's only supporting windows. DirectX is the best choice, even it's not supporting cross-platforming yet. With the possibilities of this library you can create any application you have in mind! OpenGL and DirectX were racing neck on neck a few years ago but they update of DirectX made OpenGL run behind. But it's an easy language to use. [/quote] Why do you drag Win32 into a discussion of graphics APIs? Win32 is not the C++ standard library for windows, Win32 is the basic Windows API which exposes Windows core functionality to developers. The latest OpenGL release also made it basically on par with DirectX again, so there's no issue there. I also wouldn't expect DirectX to ever go cross-platform (at least not in a way condoned by microsoft), but that doesn't mean an engine shouldn't support DirectX even if that engine will be cross-platform. [quote name='EngineProgrammer' timestamp='1349653462' post='4987801'] If you want to make it open source, be sure to really have everything bug-free, error-free. You don't want the clients to complain about your engine, even it's open source. [/quote] There's no such thing as bug-free or error-free software [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] [/quote] Sorry for my misunderstanding about Win32. I meant the header file <windows.h> with Win32. And that can also be used to write a game engine with, so I dragged it into this discussion. About OpenGL, my programming lecturer said 3 weeks ago that OpenGL is running behind DirectX and he is looking updates about programming stuff every day so I assume he is right. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Though I should have checked first on their sites before posting it here. My apologize. But still, I've programmed with OpenGL last year for a month, I think it was child coding to be honest. But in a year allot can happen of course. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] There is no such thing as a bug-free and error-free game engine? Yes there is... With enough checking code, and a good team of programmers. [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] But yes, it all depends on the client who uses your engine. If he can't work with it properly failing stuff will happen indeed. But that's not the fault of the engine but of the client. Still, a good engine would be prepared for moments like that and be sure to have enough error checking. But my experience in programming isn't that much, I just try to help others with the knowledge I have at the moment. If you can give me an example of an unfix-able piece that you can't keep error-free, please tell because I want to know. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] ~EngineProgrammer
  17. starting game engine

    Write games, not engines: [url="http://scientificninja.com/blog/write-games-not-engines"]http://scientificnin...mes-not-engines[/url] If you, after reading the article, still want to write a game engine. Continue reading. What can the game engine you have in mind do? Is it capable of cross-platforming(Windows,Mac,Xbox,Ps3,etc)? Do you want to work with Win32, DirectX, OpenGL, etc? Is it a 2D or a 3D engine? Will it be commercial, open source, private? [b]cross-platforming:[/b] To get the cross platforming done you need to check how a window is created on all consoles, how the type id's are called, etc. Here are some defines that will help you: [CODE] #ifdef _WIN32 || _WIN64 #elif __APPLE__ #if TARGET_OS_IPHONE #elif TARGET_OS_MAC #endif #elif __linux #elif __unix #elif __posix #else // unknown platform #endif [/CODE] [b]Win32, DIrectX, OpenGL:[/b] Win32 is the standard library of C++. It's only supporting windows. DirectX is the best choice, even it's not supporting cross-platforming yet. With the possibilities of this library you can create any application you have in mind! OpenGL and DirectX were racing neck on neck a few years ago but they update of DirectX made OpenGL run behind. But it's an easy language to use. [b]Commercial, open source, private:[/b] If you want to make a commercial engine like CryEngine, Unity... No chance on your own so forget this. [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] If you want to make it open source, be sure to really have everything bug-free, error-free. You don't want the clients to complain about your engine, even it's open source. If you want to make it private, I think you are better of with a simple framework instead of an engine. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] ~EngineProgrammer [b]EDIT[/b]: I'm regretting this post immediately. [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]
  18. ElapsedTime Movement?

    Working with time instead of frames will give you a more synchronized game. it's also a must when you plan to go online. Why? Assume you have 50 processes running on your computer and your enemy has 25. Your enemies game-cycle will be called twice as fast. So he will have the advantage. You add the time to any calculation for movement, shooting, camera, etc. [CODE] m_Velocity = m_Velocity * deltaTime; m_Position = m_Velocity; // you don't need to put a delta time here because it's using the velocity who has a delta time calculated in it. // This is the camera you want to move: m_Camera.moveLeft( int delta ); // Inside the method of the camera: m_CameraPosition.x = m_CameraPosition * deltaTime; // This means you need a method for the camera: void Tick( int deltaTime ) and store the deltaTime !! [/CODE] [b]Edit[/b]: If you are not sure to put a delta time with a line of code you need to think on an online game. Will the code without deltaTime have a possibility to lose synchronization? If yes, add the deltaTime. I hope this was helpful. ~EngineProgrammer
  19. Episode 1 of Game Programming, a Video Series

    I've never programmed in java but I don't think that will be the point with my opinion. It's not smart to pick a 'random' resolution. In C++ the function 'ChangeDisplayMode" returns false at random resolutions that doesn't exist. When the gamer goes to options he might want to change the resolution. So give him known ones(640*480, 1024*768, 1280*720, etc) link: [url="http://en.wikipedia.org/wiki/Display_resolution"]http://en.wikipedia....play_resolution[/url] (scroll down a bit) I mostly use 640*480 to start my projects with. When I create a game I'm trying to get around 1360*768. And then adjust my resolution to a "fullscreen" window for the gamer. And 3-5 minutes each video? You have written 5 lines of code now so maybe go a little bit faster, or make the video much longer? [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] ~EngineProgrammer
  20. Ah this is a good place where I can ask a question about android as well. (this question continuous on the OP's question) Android games give you profits. But how much? I can't find everywhere how much % you get from each buyer. Assume, I've written an android game that costs 1€ on the android store. My game is decent so I have 10 000 people buying my game. How much profits will I have? Would be nice if someone could answer on this. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] ~EngineProgrammer
  21. How Do You Plan?

    Thank you for the fast response Alvaro. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] You are programming for 30 years now, that's nice! I have 2 years of experience now hehe. It would be awesome if you could help me out. You have more experience and you could help me allot now. I know I'm not the OP but, I want to rewrite this game for another school project: [url="http://www.rocksolidarcade.com/games/robokill/"]http://www.rocksolid...games/robokill/[/url] How would you handle it? Please play the first level and explore how you would create a game like that. I owe you one. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] ( [i]moderators this is not offtopic. I'm asking a plan to Alvaro.[/i] [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] ) ~EngineProgrammer
  22. How Do You Plan?

    [u]Superman3275[/u], you can see 3 different ways now to get started. This means everyone has [b]his [/b]special way of programming, and you need to find your way. Seek out what's the best for you. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Downloading open source games / engines, exploring them has been a great help for me. So I suggest you to do the same. Look how other people have done it. How they structure their classes, how they have written their lines of code, etc. It's very hard to [b]tell [/b]you a structure / design. You need to explore / see it for your own. [u]Telastyn[/u], I also try to work everything out in my head. But when a week has passed it's hard to remember where I was. [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] That's why I'm writing/drawing it all. So if I look at my paper a year later I can still remember what I've done. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] [u]Alvaro[/u], I used to work the same way as yours. But I disappreciate it.. Coding immediately caused me allot of messy code, which made me create new projects over and over again. And after that I got 10 files with sort of the same code and I need to look in all of them first to know what I was doing. My first year of programming I made Dragonball Z: supersonic warriors. I've count the number of versions I have: 17. With only 1 working completely. But the examination went pretty good with that file [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]. After the examination in school I asked the lecturer how he started when he had a game in mind. He said: [i]"I can't tell you that. Every programmer has his own way of thinking so I cannot tell you how to program like me. But I can give you a hint: Storage your information so you can return at it any time."[/i]. And so I came with a piece of paper and a pencil. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] ~EngineProgrammer
  23. How Do You Plan?

    Assume I want to create a game for example 'MotherLoad': [url="http://www.miniclip.com/games/motherload/en/"]http://www.miniclip..../motherload/en/[/url] [b]I write down everything I need[/b]. In this case: - Tileable sprites for the dirt, copper, tin, etc - sprite of a vehicle - Bitmaps for buildings - Bitmaps for menu's when your vehicle comes closes to a building - Sounds - Day/Night -> Bitmap of a sun that moves in a circle. Ok I got kinda the basics. [b]After this I draw on a piece of paper what classes I'll need and link them[/b]. [CODE] class main; // entry point of the application class Window; class System; class Graphics; // will be created in the main.cpp class Bitmap; class Sound; class Text; // stores handles to the images, fonts, etc class Vehicle; // this will store an object of Bitmap for your vehicle. class GameState; // will keep a state ( static int m_GameState = STATE_IN_GAME; // or STATE_MENU_MODE; such things. class Game; // this will create all game objects, sounds, etc. Also checks collisions. class Level; // contains information how the level looks like class LevelProp; // props like dirt, copper, etc. Can be a virtual class and support sub-classes. [/CODE] [b]Linking I do with drawing arrows from class to class.[/b] Still don't have any code. Now I think [b]"What possible methods can the classes contain?"[/b] I give 1 example: [CODE] class Bitmap { public: Bitmap(string path); // Loads an image from a file ~Bitmap(); Bitmap* GetBitmap(); void SetAnimationRect(RECT bounds); RECT GetAnimationRect(); void StartAnimation(int from = 0); void StopAnimation(); void PauseAnimation(); void SetAnimationSpeed(int speed); void IncreaseAnimationSpeed(int speedDelta); void DecreaseAnimationSpeed(int speedDelta); void Render(int posX, int posY); // The position can also be stored and called with a method: SetPosition(int posX, posY); private: HBITMAP m_hBitmap; RECT m_Bounds; int m_AnimationCounter, m_AnimationSpeed; }; [/CODE] Of course this class sucks. [img]http://public.gamedev.net//public/style_emoticons/default/laugh.png[/img] It was just an example so don't copy that one. [img]http://public.gamedev.net//public/style_emoticons/default/wink.png[/img] And in case you are wondering, why not painting(Photoshop) and typing instead of drawing(on paper) and writing? Answer: You only need to have a basic idea for your whole game. So don't waste time with with PS or Notebook.. Drawing & Writing goes allot faster. ~EngineProgrammer
  24. Advice for Graduation Project game

    A genre that has 2 teams, small environment and no levels looks like an RTS for me. - Creates barracks that automatic spawn creatures to the other base ( the stronger the creature, the more time it takes to spawn ). - The creatures follow the shortest path. - Put some environment in your map so you, as player, need to build your barracks on a good spot so your creatures will reach the other side faster. - Get some economics in it so you need to balance out your base with barracks <-> income. Smart building means more chance to win! The fact you are asking what language best fits means you know basics of different languages or just don't know a single programming language. What language you should take depends on yourself. I like programming in C++ because it has no limits. Java is written in C++, don't uses a stack, so only heap for every object. I don't know anything about other languages. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] ~EngineProgrammer
  25. [SFML] Breakout Help :(

    Do you know why this happens? Because you are thinking I'm going to handle over all the code.. Block* pBlocks, you can clearly see a ' * ' in my code. This is a dereference. Or in other words, this is a pointer. It stores an address of an object it's location. [url="http://www.cplusplus.com/doc/tutorial/pointers/"]http://www.cplusplus...orial/pointers/[/url] I found 2 errors, I can't find any error at the moment. Try using break points. Put some breakpoints in your main functions and go over the methods one by one. When you get the break error after jumping over a method, it means you are doing some strange stuff inside that method. ~EngineProgrammer
  • Advertisement