|
|
This thread is locked; no one can reply to it.
|
1
2
|
| Do you use .dll's in your game vs .lib? |
|
lin lin
Member #7,251
May 2006
|
So .dll should optional, but .lib should be highly recommend right? Since putting all those functions in a header file is considered a bad idea. Every game should be static linked with .lib files. While .dll should be optional... I just don't want people going in messing with my code. If I have a .dll file with all the character stats on there, they can go in and motify it. My own format would help to prevent this. |
|
Arthur Kalliokoski
Second in Command
February 2005
|
lin lin said: I just don't want people going in messing with my code. If I have a .dll file with all the character stats on there, they can go in and motify it. My own format would help to prevent this. If it's a network game, keep the stats on a server where they can't mess with them. If it's not a network game (single player) what's the problem with them messing with them? They're only cheating themselves at worst, modifying the game to make it more fun for themselves at best. They all watch too much MSNBC... they get ideas. |
|
lin lin
Member #7,251
May 2006
|
Hey off topic question.... Anyone know a good place you can find sprite artist? Are they a rarity? Can't seem to find any that are that good.. |
|
Trent Gamblin
Member #261
April 2000
|
There is some decent art on http://opengameart.org... but you're unlikely to find EVERYTHING you need for a complete game.
|
|
lin lin
Member #7,251
May 2006
|
Arthur Kalliokoski said: If it's a network game, keep the stats on a server where they can't mess with them. If it's not a network game (single player) what's the problem with them messing with them? They're only cheating themselves at worst, modifying the game to make it more fun for themselves at best. .... wait a minute.. Isn't the .dll's encrypted? You can't just open it in Visual Studio because it's a compiled, linked, binary product, just like an exe. |
|
Arthur Kalliokoski
Second in Command
February 2005
|
Machine code isn't "encrypted" except in the sense it's readable by the CPU rather than humans. If you put human-readable stuff into a DLL you could read it with any hex editor/viewer. There will probably be a few function names you can read even in a code DLL. They all watch too much MSNBC... they get ideas. |
|
tobing
Member #5,213
November 2004
|
I can't help but thinking that lin lin doesn't yet understand how C++ programs are built from source. Does anyone have a good reference to that? |
|
lin lin
Member #7,251
May 2006
|
What you suggest I do? if I want to use the .dll for new levels but I don't want people opening it up and messing with it? I could create the .dll first then have a program that encrypts it. The end-user will receive the game. Before the game runs it'll look for the .dll decrypt it and then run normally. I wonder.. If I am willing to go through this much trouble, might as well just make my own file type... |
|
Vanneto
Member #8,643
May 2007
|
Go to Wikipedia and read about these topics:
A lot of reading, but believe me, you need it. In capitalist America bank robs you. |
|
tobing
Member #5,213
November 2004
|
First you have to understand what a DLL is. You don't put levels into a DLL. So how does C++ building work? C and C++ files are compiled into object files, which contain relocatable machine code. Typically these files are *.obj (or *.o on linux). Next step is linking into an executable file, which means to throw all the object files together and resolve all open symbols (like function calls and global variables). Result is an executable. Collections of object files can be put into a library, typically *.lib (or *.a on linux). Such a static library is exactly that, a collection of object files to link with. Primary purpose is to keep linker statements shorter, and have libraries which are good for reuse in more than one project. Shared libraries are working quite differently on Windows and on linux. On Windows they are DLLs, on linux *.so files. A special thing on Windows is the fact that a DLL looks very much like an executable files, but in the end, it's just a shared library, which is only loaded when the starting program (which is a *.exe) loads the DLL. This can be during startup or by dynamically loading the DLL as needed. Either way, loading the DLL involves a link step, and after that, the executable in memory is completely linked, all symbols resolved and relocated, so it can execute. To answer your question, it's mostly a matter of taste, if you prefer static or dynamic libraries. Linking large programs can become really slow, using DLLs can help a bit here. On the other hand, the programs that you typically write, compile and link within seconds or a few minutes, so there's no problem. Using static libraries makes the executable look bigger, but it's self contained (doesn't need to resolve symbols during runtime). Using dynamic libraries means you have to distribute them, and their summed sizes are bigger than the executable alone. None of this is an issue these days. I'm going towards static libraries for my own projects, especially when I try to go for Allegro 5, makes things a bit easier for me. Put your game content into directories and files that you can easily read, like using load_bitmap. You will have your original data somewhere, and at least during development it will be so much easier to read those files directly, in comparison to introduce another build step that packs your original data into any sort of pack, zip or whatever file to read in in your game. |
|
Michał Cichoń
Member #11,736
March 2010
|
Levels in DLL? Maybe it is better to try data driven game, same code base with different data will result in different game. I do not thing it is wort to encrypt game code unless you are planning to use some fancy DRM mechanism. (Yeah, people will not like you for that.) Don't bother about code encryption unless you have to. People when want, they open it anyway. If you really want encryption, make a proxy interface for all I/O operations and after your game is finished encrypt data with SSH or some other method and implement different I/O proxy which allows you to read it. Bottom line is, you code and assets will not be protected enough unless hardware guarantee that and regular PC, Mac, iDevices and other popular platforms do not have such feature. So sorry, you have to live with that. "God starts from scratch too" |
|
Dizzy Egg
Member #10,824
March 2009
|
Regarding something mentioned earlier, about only definitions/declerations being in header files: I put all of my class definitions in header files, and all the class functions go into a .cpp file; however, sometimes if there is an extremely basic function in a class that simply returns a class member, I put that into the class definition in the header file: Would this be frowned upon? Should ALL functions go into the .cpp file, regardless of complexity/number of lines?
---------------------------------------------------- |
|
|
1
2
|