Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Dec 2002
Offline Last Active Jul 20 2014 06:09 PM

Topics I've Started

thoughts on using blob data for image resources

19 September 2009 - 02:26 PM

Some background information: Game type: 2d Final Fantasy 1-6 style Networked RPG - overworld and sub maps for towns etc. Graphics: SDL (windowing/input only) and OpenGL Language: C/C++ So far I have had some success with a main sqlite3 database file and separate map files which are also sqlite3 databases. Until recently I have been storing all of the sound and image files in sub directories that the map files store relative paths to as their required resources. Works well and all but one of the project's goals is to encourage users to create new maps however I began thinking that keeping track of resources may become a bit hairy this way. I recently started experimenting with putting the raw image and sound data into the sqlite3 database map files as blobs so the map files themselves could be more stand alone. I am having some good results with this however I am wondering if there are some drawbacks I am overlooking. On the positive side I have seen that I no longer need 3rd party image libraries for the actual game. I know - not much of a positive but I like it. I still use SDL_mixer to do some sound effects but no longer use SDL_image. Then there is the main concept of a fully modular map that is cross platform and can be shared from user to user without fear of missing resources. I don't have a Mac to test on but I know the map files work on Windows XP, Vista 32 and 64 bits and Linux 32 bit (haven't test 64 bit Linux) and all I have to do is add the map file to the map directory and the game recognizes it on startup and prompts me to add it. On the negative side I end up duplicating a lot of the art work among the map files which makes the map files much larger. There is also the issue of dropping resources I am just going to reload again in the next map. I am thinking of placing some common map textures in the main db (UI textures are already in there) to alleviate this but it hasn't been a performance issue as of yet due to the game being light on resources in it's current state. Suggestions and comments? Also - it is not my intent to obscure the content from the users although this does add a certain level of obscurity with the intent that the content necessary for a particular map is kept together to make the point it should not be edited in pieces but as a whole entity. Not sure if this is a pro or a con - your feedback is most welcome on this issue. In general at work I am always making cases against putting blobs in the databases because it just causes performance issues (Not a DBA but I wear the hat occasionally). In this sense I think it actually makes sense since it is an embedded database situation where the performance issues don't really exist however again your feedback is most welcome. Some may also deem this as relevant - This discussion refers to managing resources on the client side using sqlite database files. The server side also uses the same sqlite database files at this time but I began this fully aware it may need to move to a more robust RDBMS. Sorry for the long post - I have been working late lately and haven't had much time to continue work on my game and the issue of time prompted my post here to bounce ideas off other people since I am working this project by myself (well I am the only one who works on the games internals).

SQLite3 suggestions

21 September 2006 - 04:45 PM

I have been using SQLite3 for a while now but only through thin wrappers that don't do much error checking. I am currently converting an extensive flat text file database into an SQLite3 database because of it's flexibility, portability, embedability (sp?), small size and ease of integration. The game server runs on a linux machine and the clients are generally on windows but some on other OS's as well but windows and linux being the 2 main platforms. The main reason I am going with SQLite3 over something like MySQL is that I can embed it in the app and only have to distribute the sqlite3.dll file or the equivilent on linux and no server has to be connected to or started to use. This comes into play on the client side because the client will able to get schema information from the server to create/update a compatable local database for creating new content for the game that can be submitted as a sql script for approval before being introduced into the actual game. I started by creating my own thin wrappers around the SQLite3 API knowing ahead of time some were available for me to download but wanted to know what was going on and what can go wrong before getting used to the limitations of just one wrapper. This has worked out fine so far but the thin wrapper has gotten a little large and now it looks a bit more like something that 12 people put together each with varying knowledge of the underlying SQLite3 API [smile]. Finally, onto the question at hand. I have decided that I know enough about the inner workings of SQLite3 to know that I don't want to re-write anymore if I don't have to. So are there any suggestions on available wrappers that are cross platform? Preferably that use STL containers and strings and don't involve linking to another lib. This is a pain for me because I am not too good at making/using makefiles.. yeah VS has spoiled me since the days I began learning Turbo Pascal on the 286 in high school in an editor resembling DOS edit. I am currently looking at the ones available from the SQLite.org web page but any suggestions on what some other people have found useful would be great. Thanks in advance /*------------------------------------------------------ FYI - converting an existing text based MUD to be sort of graphical. Think DikuMUD meets Roguelike meets Atari. Using SDL for graphics & input, SDL_Net for networking although possibly moving to NET2 in the near future. I haven't chosen a sound API yet but leaning towards SDL_mixer or FMOD and obviously I have chosen SQLite3 for a database. -------------------------------------------------------*/

tilemap in 3d not 2d - 3d newb

10 August 2006 - 03:19 PM

So far I have been doing my tilemaps/terrain in 2d via quads the same way I would do them in 2d - that is "blit" each tile that is visible on the screen from left to right - top to bottom. I have come to realize that I could be doing much better looking stuff easier in 3d if I only had a clue. The fact is I can fake 2d with OpenGL pretty easily and still have great performance. But why do this when I could use 3d directly and get even better performance? - Answer- I just don't understand all of the 3d concepts I feel that I should to be able to do this. For instance. I know I should be rendering my terrain as som kind of "mesh" in order to light it properly but everytime I look it assumes I even know what a mesh is and how to make one. I get that it is basicly a "mesh" of vertecies and I can create one from different formats of data but then come the glLoadIdentity and glTranslate calls. Unfortunately I was never any good at calc/trig in school and the matrix math stuff eludes me to be quite honest. So, onto my initial question... How do I go about creating a tilemap ( say 3 screens wide by 4 screens the other way ) using 3d instead of just texturing quads - my current 2d mindset? If I am reading my literature right this will enable me to use 3d world space and lighting and loads of other goodies for virtually free. Please bear in mind the following if you answer - although I have read and read OpenGL tutorials, referenced the red and blue books, I still do not fully understand the concepts of: 1. what matrix mode I am in and why it makes a difference 2. the term "units" is pretty vague when speaking to someone coming from 2d where I speak in pixels although I think I slightly understand this concept. 3. heightmap is a foreign term to me. I know what it is supposed to represent but I have no idea how to load it and put it to use (other than copy paste). 4. loading a texture for anything other than mapping it as it is to a quad (triangles are new to me as well). There is more but I think this is way more than I should have written in my first post.

Content generation and where does it start

23 September 2005 - 08:18 PM

The following applies towards tile map based games and possibly belongs in the isometric and tile based games forum but I thought that some alternative libraries being used might become part of the topic as well. Here are some questions I would like to discuss and hopefully lead to some help for myself and other people with the same dilema. Do you integrate your content generation/editing tools into your games or are they seperate applications? Do you use 3rd party libraries/applications to create and edit content such as graphics, sound and tile properties. If so which ones and how do they make your life easier. Do you start off using say a static array of tile indexes and then move on to a much more complex map format or do you create something close to your final map format first and then code the game around that format or perhaps something totally different. I myself find that creation of a tile/map/content editor and generating decent content from it is far harder than coding the physics, gameplay etc. But on the otherhand how do you test your gameplay/physics etc. without suitable content to begin with? Sounds like a catch 22 to me, what's your take? Please use real life examples and post links if you can because I think we could all benefit from eachother on this one. Just for kicks, this post started off as a reply to this topic specificly regarding the Mappy program. I had some questions of my own and a new thread was more appropriate. I hope EDI reads this because I am awed by the work he did with "Mornings Wrath" and I hope he can share some of his thoughts on this. BTW, check out the "Mornings Wrath" demo. It really is worth your time. And please excuse the spelling and grammar, it is almost 2:30am so this might all be gibberish and I won't know until tomorrow [help]

changing color of textured quad (solved)

22 May 2005 - 11:46 AM

I have a black and white texture and I want to change the color of the white parts based on user settings so that I don't have to have multiple textures of the same thing only in different colors. With SDL I was doing this by modifying the palette. While I am moving to OpenGL (quite the newbie) I thought this could be done by specifying a color to blend it with but this causes the texture to be blended with everything else behind it. Any ideas what I am doing wrong or how I can prevent this? Some helpful info: using glOrtho almost exclusively (2d app) texure is loaded as a 32bpp texture (used to be 8bpp palettized in SDL) black parts of texture are fully transparent (alpha value of 0) blending and alpha test are active but have tried disabling/enabling them and all combinations of the sort. Thanks in advance [edit] SOLVED [/edit] Thanks to ProPuke I went over what I was doing and realized that I indeed needed to disable blending but I kept the alpha test in order to allow the black background (with an alpha value of 0) of the texture to be transparent. I had in error forgot to set the alpha value of the black back to 0 when I was trying to get it to work last night and doing what I could to find the cause of the problem. Thanks agan [Edited by - evillive2 on May 22, 2005 6:56:47 PM]