• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Nazzrim

Members
  • Content count

    8
  • Joined

  • Last visited

Community Reputation

136 Neutral

About Nazzrim

  • Rank
    Newbie

Personal Information

  • Location
    Germany
  1. DvDmanDT: Okay, does that mean that the way a library is linked is determined only by the library and not by the way I actual code it? If it does I got it :>. I didn't know that a library "sets itself" to static/dynamic. Maybe I should get information about DLL's in general. With this, kept in mind the following sentence I found on SDL site makes sense to me, because now I know that this resulting the dll being a dynamic one. And if I want to know if a library is dynamic or static I have to examine the library itself. Helped me a lot. Thank you [quote] Can I use SDL in a commercial application? Yes! If you link dynamically (via .dll's, .so's or using other dynamic linking devices) then you do not need to to anything. If you link statically (include the SDL source inside your project when you compile) you have to provide some way for your customer to relink your application a custom version of SDL. [/quote]
  2. [quote name='Radikalizm' timestamp='1338305617' post='4944342'] [quote name='Nazzrim' timestamp='1338301601' post='4944323'] @Radikalizm I think I got it now ;-). If I link dynamic there is no need of a Link-flag, because everything gets resolved at runtime. But if I don't want to link dynamic I have to tell the Linker where to look. If I seperate the #include from the rest in my mind, there is no need of an include statement if I use dynamic link, because then I would be forced to include everything out of the header file. But how can I get access on classes/flags used inside a DLL. And not special for SDL: Why can there be more than one linker-flag for one DLL? Can a DLL contain different separated libraries? Hopefully the last two are not SDL specific and more like "problems of general DLL usage" ;-). [/quote] You're still confusing your concepts; as I said, the include statement has absolutely nothing to with linking, so there's no association to be made between static/dynamic linking and including header files. I think you should maybe pick up a book on programming in C++ to get your concepts straight, a forum isn't exactly the right place to learn all these elementary things [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] [/quote] Maybe I didn't point out my thoughts clearly: If I use the include statement, the whole content of the header file is included into my executable and because there is no implementation of the functions the Linker will look at the locations I tell it. I think I nearly understood the concept of include statement / dynamic/static link (will do some practice on that) but maybe I am not able to find the right words... My actual problem is that I don't know how to handle this information in C++, or: How does a static/dynamic link look in C++? Until know I thougt thats its static if I use Link-Flags and if not its dynamic. And yes you are right, I thougt my problem is a lot smaller, but I think I should consider some lecture. But thank you very much:-). @DvDmanDT: Thank you. Hopefully got it.
  3. @Radikalizm I think I got it now ;-). If I link dynamic there is no need of a Link-flag, because everything gets resolved at runtime. But if I don't want to link dynamic I have to tell the Linker where to look. If I seperate the #include from the rest in my mind, there is no need of an include statement if I use dynamic link, because then I would be forced to include everything out of the header file. But how can I get access on classes/flags used inside a DLL. And not special for SDL: Why can there be more than one linker-flag for one DLL? Can a DLL contain different separated libraries? Hopefully the last two are not SDL specific and more like "problems of general DLL usage" ;-).
  4. @Radikalizm Wow, thank you very much. That helps alot :-). So is it right, that DLL's are designed for dynamic linking, and every use of them is a dynamic link? I'm not sure if I got it: I will definitly read about import libraries, but what is the benefit against using #include <...>? Is is, that it would include the whole library instead of only the necessary things? @kloffy Thank you I will read it as soon as possible:). I think I didn't/don't(;-)) understand the meaning of a DLL, because SDL is released with LGPL and it only allows other licences if dynamic linked, so I wanted to learn more about it, poorly the only thing I knew at this point was: "everything comes out of this DLL Oo". So I thought this could be the right way.. But it seems to me that every DLL use is dynamic Oo. Great misunderstanding.
  5. Hey everyone. I am learning SDL for some month now, which dramatically increased my C++ skills. But I have some questions about the use/general function of DLL files: 1. My interpretation of DLL file is a collection of functions and classes (not necessarily C/C++) provided for other programs. Is this right? 2. On different sources I read about "static linking" & "dynamic linking" but I am not completely sure about it's meanings: If I use #include <SDL/SDL.h> the header file for SDL.dll is directly included into my project when compiled. I hope till this point I am not wrong... This way the DLL is linked static because the specific header for this DLL version was included, isn't is? So you can't exchange the DLL version because of eventually lacks of compatibility? And if I want to link a DLL dynamic I include <windows.h>. I have a bunch of typedefs for the used functions like: [CODE] typedef int (*SDL_Init_i) (Uint32); [/CODE] And then I have to get the address of the called function at runtime with some code like this: [CODE] SDL_Init_i iSDL_init; HINSTANCE hSDL = LoadLibrary("SDL.dll"); if (hSDL) { iSDL_init = (SDL_Init_i) GetProcAddress(hSDL, "SDL_init"); if ( !iSDL_init) { return 1; } } else { return 1; } [/CODE] After that I hopefully can use the function probably this way for example: [CODE] if (iSDL_Init (SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1) { log->log("SDL init error..."); return false; } [/CODE] At the end of my programm I have to free my program with FreeLibrary(hSDL);. This way I have the possibility of changing the SDL.dll for example with a newer version, haven't I? So now the actual questions for 2. ;): - Is my knowledge about DLL linking correct? - If it is: Isn't there a cross platform solution for dynamic linking or: how would this be done in a Linux environment? - I have chosen the example above because it shows an other problem: If I link a DLL dynamic, how can I use special flags or classes out of this DLL (like SDL_INIT_VIDEO or SDL_Rect as class)? 3. If I am compiling I always use the following flags: -lSDL -lSDLmain. I know they are used for the Linker and they tell what to use but why are there two for one DLL? If I also use SDL_image.DLL I have to add -lSDL_image. So exactly: What is the -lSDLmain flag for? 3.a. Is there a difference in linking static/dynamic and the use of flags? Because I "hardcode" the DLL filepath when linking dynamic, so there is no need of extra compiler flags? 4. Why are there Runtime Libraries & Development Libraries? Just a missing documentation or what is the difference? 5. Inside the lib folder of SDL there are .a files. What are they used for? I read some tutorials about DLL's and the .a files are a product of creating DLL's (surprise...). Are they part of dynamic/static links or are they needed always? EDIT: 6. If I link dynamic: Is it better to include all needed DLL-functions/classes/etc. at once at the beginning, or should I load the DLL every time a function is needed? I am not sure because I don't know how fast DLL's are. Maybe they are a bottleneck, I don't know;). Or it would consume too much memory to save all function-addresses the whole Runtime? I hopefully didn't scare you with my bad English skills and/or my newbie problems;). I am thankful for every help. Nazrim
  6. Yes it flushes every time: [CODE] void Log::log (std:: string message) { logger << message << std::endl; logger.flush(); } [/CODE] I am not completely sure what the difference between release/debug mode (- maybe someone got sources :S? -). So I use Notepad++ for coding, and mingw32 via cmd for compiling. I have a bunch of header files for my classes and .ccp files for the actual classes. I am compiling it using the command "g++ 'all.ccps' -lSDL -lSDLmain -lSDL_image. This are my includes DLLs: libgcc_s_dw2-1.dll libstdc++-6.dll libpng15-15.dll SDL.dll SDL_image.dll zlib.dll The first two are there, because my notebook complains if they are not *shame* The rest are SDL and related DLLs. I must concede that my DLL skills tend towards zero, but I really like to improve them. ;-)
  7. Right after start up before the gameloop starts working state is initialized to MainMenu state. [CODE] int main (int argc, char* args[]) { if (init() == false) { log->log ("Error on initialisation..."); return 1; } actState = STATE_MAIN_MENU; workingState = new MainMenu(); while (actState != STATE_EXIT) { [/CODE]
  8. Hey everyone. [left]At first: Please excuse my poor English skills :-(.[/left] [left]But let me tell you about my problem:[/left] [left]I wanted to lean how to use SDL. So, at first I read some articles and tutorials. Then I started to code a "game", less a game, more object of my personal study.[/left] [left]I want to create a framework, which grows with my knowledge, where I can implement my ideas and learn out of it.[/left] [left]I have chosen C++ because I already have some Skills in it and want to improve them.[/left] [left]This is my working state:[/left] [left]- I am using Windows 7 64bit Professional[/left] [left]- game-state-machine with actual 2 states (menu & "game"-mode)[/left] [left]- button, timer, tileMap, animation, player, bitmapFont & log classes[/left] [left]- menu state shows a background, with a barely animated cloud and a button, which switches to gameState[/left] [left]- game-mode has a tileMap based background with a level read in by a file, A test of the bitmapFont, and a moveable "hero" with a camara following him (2D if there are any uncertainties) and an exit button.[/left] [left]All this works fine on the computer I coded it on.[/left] [left]Now the actual problem:[/left] [left]I placed the compiled .exe and all necessary .dll's and images in my DropBox because I wanted to test it on my notebook and I direct linked the folder with a fellow student.[/left] [left]On the source computer it isn't possible to start the game, direct ".exe doesn't work anymore..." (- hope I translated this one right -).[/left] [left]On my Notebook (also Windows 7 64bit Professional / no seperate SDL installation) the game starts correct and enters the main Menu, but if click on the new Game button the game closes without any error message.[/left] [left]So I set up my log and logged every step happening (See code & log below).[/left] [left]This way I pointed out that the program exits without a reason (visible for me) after the end of the constructor of the exit button in game state.[/left] [left](This is the most important problem)[/left] [left]On the computer of my friend (he actually tested with ArchLinux) it works fine in some cases or it isn't startable. (Also interesting, but it's more important for me to get a working version on my notebook, but I am interested in articles/tutorials about using SDL cross platform, because reading windows and linux tutorials and then point out the differences isn't fun, I think.)[/left] [left][i]Edit: Talked to my friend again, he used windows, too, but I am still interested in cross platform sources.[/i][/left] [left]I am thankful for every help and advice you can provide me. :-)[/left] [left]If new Game button is clicked nxtState is set to STATE_HOME_FARM, changeState is called every gameloop before rendering.[/left] [left][CODE] void changeState() { if (nxtState != STATE_NO_CHANGE) { log->log("start change"); if (nxtState != STATE_EXIT) { log->log("delete act"); delete workingState; log->log("done"); } switch (nxtState) { case STATE_HOME_FARM: log->log("detected home farm"); workingState = new HomeFarm(); log->log("createt state"); break; } log->log("set vars"); actState = nxtState; nxtState = STATE_NO_CHANGE; log->log("done"); } } [/CODE][/left] [left]This is the constructor of my HomeFarm class.[/left] [left][CODE] actWid = LEVEL_WIDTH; actHig = LEVEL_HEIGHT; log->log("create hero"); hero = new Farmer; log->log("create exit button"); exitButton = new ExitButton(SCREEN_WIDTH/2, SCREEN_HEIGHT-200 , 200, 100, "Buttons/test_button_exit.png"); log->log("create font"); [/CODE][/left] [left]This is the constructor of my ExitButton class[/left] [left][CODE] log->log("set vars"); CLIP_MOUSEOVER = 0; CLIP_MOUSEOUT = 1; CLIP_MOUSEDOWN = 2; CLIP_MOUSEUP = 3; button.x = x; button.y = y; button.w = width; button.h = height; log->log("load img"); img = loadImg(filename); log->log("set clip"); setClips(); log->log("set initial clip"); state = &clip[CLIP_MOUSEOUT]; log->log("done"); [/CODE][/left] [left]And finally this is my log.txt created if I run the game on my notebook and try to start a Game.[/left] [CODE] start change delete act done detected home farm create hero create exit button set vars load img set clip set initial clip done [/CODE] [left]Nazzrim[/left]