I prefer MySQL over Postgre, but it's really personal preference.
I've only ever used mySQL at home, and Oracle and our proprietary B-tree garbage at work. I had heard mySQL doesn't scale as well as Postgre. Not that my home projects have any scale to speak of, but how true has this held for you?
GnomeTankWhat the what?Portland, OregonRegistered Userregular
edited September 2010
I don't really know the answer to that question, I have never used MySQL for anything so large scaling became a serious issue. I've only used SQL Server and Oracle in those scenarios.
e: I should add, I prefer MySQL over Postgre from a pure usability point of view. MySQL and it's tool feel very familiar to me after using SQL Server for so many years. Though the SQL dialect is more like PL/SQL (as much as something can be like PL/SQL), the GUI tools are very SQL Server-esque.
I don't really know the answer to that question, I have never used MySQL for anything so large scaling became a serious issue. I've only used SQL Server and Oracle in those scenarios.
e: I should add, I prefer MySQL over Postgre from a pure usability point of view. MySQL and it's tool feel very familiar to me after using SQL Server for so many years. Though the SQL dialect is more like PL/SQL (as much as something can be like PL/SQL), the GUI tools are very SQL Server-esque.
I agree on all points but the GUI tools. Because, umm...what GUI tools are you talking about?
I've used the query portion, and I wasn't a fan. The query editor is too small, unless you use the script editor, but then I didn't see a way to get output back from a query.
End on
I wish that someway, somehow, that I could save every one of us
The project I'm currently planning involves recipes, but I thought it would be a good idea to get an idea of what's available in general (in terms of publicly available datasets) for the future.
I prefer MySQL over Postgre, but it's really personal preference.
I've only ever used mySQL at home, and Oracle and our proprietary B-tree garbage at work. I had heard mySQL doesn't scale as well as Postgre. Not that my home projects have any scale to speak of, but how true has this held for you?
It's bologna. For instance DAoC was built around it.
MySQL had speed, Postgre had "features." That gap is substantially closed in on. The largest reason to use MySQL? Pretty much everyone and their mom uses it for a LAMP setup. Postgre you have to go out of your way. Chances are if you need help, someone can give it with MySQL. Not so much so with Postgre.
I think Postgre's largest draw was stability and failover features. Not sure how much has changed as I don't keep on top of them anymore. But I do remember Postgre was the most stable of the SQL servers a few years back.
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
0
Sir CarcassI have been shown the end of my worldRound Rock, TXRegistered Userregular
edited September 2010
This seems like a good a place as any.
If you browse H/A regularly, you probably know that I occasionally mess around with game programming, typically rogue-like type games, and apparently do everything the wrong way.
I've been messing around again, and had a question. I'm using libtcod with C++, if it matters. This is regarding displaying tiles and the things that might occupy those tiles. I have a class for storing my map information that basically creates a large 2d array and stores various info relating to that tile, isWalkable, isTransparent, isExplored, etc. My render function centers the PC and draws the seeable tiles around him, and scrolls as the PC walks. I can draw the tiles fine, but now I've started trying to draw other things, like npcs and items.
I had npcs drawing fine, but it was horribly inefficient. I currently store my npcs in a linked list, and I was basically navigating through that list for each tile to see if an npc was there. I had the idea of instead going through the list once and storing each npc's position in a character array as their graphic, then checking the relevant position in the array for each tile that's in view. That would probably work, but then I thought about other things that might be there, like items or monsters, and what if there are multiple items in a tile, etc. Or just simply trying to get information about the npc in that tile. Surely there's a better way. Any suggestions?
Also, are there any good online resources for this kind of thing?
Your map array could hold another piece of information, pointer to an object. If an object is in the square, you can find out directly, rather than traversing the linked list each time. I mean you'll probably want a linked list to hold them anyways for AI logic and such, if they're moving or performing actions, but, the map itself could hold an "object" address and point directly to an npc, an item, or monster.
That way as you hit the tile you can do a quick check, display them, and move on.
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
I prefer MySQL over Postgre, but it's really personal preference.
I've only ever used mySQL at home, and Oracle and our proprietary B-tree garbage at work. I had heard mySQL doesn't scale as well as Postgre. Not that my home projects have any scale to speak of, but how true has this held for you?
It's bologna. For instance DAoC was built around it.
MySQL had speed, Postgre had "features." That gap is substantially closed in on. The largest reason to use MySQL? Pretty much everyone and their mom uses it for a LAMP setup. Postgre you have to go out of your way. Chances are if you need help, someone can give it with MySQL. Not so much so with Postgre.
I think Postgre's largest draw was stability and failover features. Not sure how much has changed as I don't keep on top of them anymore. But I do remember Postgre was the most stable of the SQL servers a few years back.
Yeah, mySQL has been an absolute breeze to set up, so I'm not going to use anything else for the foreseeable future. It doesn't hurt that every LAMP tutorial is mysql focused. Now I just have to figure out how to wrap mysqli in my own class to throw the appropriate exceptions.
Why not look at a roguelike's source and see how it's done?
I may end up doing that, but it would mean digging through a ton of code to find where they do it, and then trying to figure out how they do it. I'm not sure I'm quite up to that task yet, to be honest.
Your map array could hold another piece of information, pointer to an object. If an object is in the square, you can find out directly, rather than traversing the linked list each time. I mean you'll probably want a linked list to hold them anyways for AI logic and such, if they're moving or performing actions, but, the map itself could hold an "object" address and point directly to an npc, an item, or monster.
That way as you hit the tile you can do a quick check, display them, and move on.
But what if there are multiple things in a single tile, like a an npc that drops all of his equipment?
For instance, this is pseudo c# code, no idea if it'll compile
public class GameObject
{
//the base class for game objects
//npcs, monsters, items, whatever
}
public class MapTile
{
public Image tileImage;
public GameObject objectAtTile;
}
public static void main()
{
MapTile[,] theMap = new MapTile[25,100];
//do all the rest of your junk here
//then you could do something like
if(theMap[x,y].objectAtTile != null) {
theMap[x,y].objectAtTile.Move(-1,0);
}
}
That should be more or less what you want to do in that situation. Traversing through the list matching x,y combos could make that a much worse process than it has to be. I'd probably still keep the linked list for AI logic like I said, traverse it to see if you need to do any processing. Move an NPC, make a monster shoot a weapon, whatever. Then it could update the map itself on logic too, so you have two ways to do it.
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
If you browse H/A regularly, you probably know that I occasionally mess around with game programming, typically rogue-like type games, and apparently do everything the wrong way.
I've been messing around again, and had a question. I'm using libtcod with C++, if it matters. This is regarding displaying tiles and the things that might occupy those tiles. I have a class for storing my map information that basically creates a large 2d array and stores various info relating to that tile, isWalkable, isTransparent, isExplored, etc. My render function centers the PC and draws the seeable tiles around him, and scrolls as the PC walks. I can draw the tiles fine, but now I've started trying to draw other things, like npcs and items.
I had npcs drawing fine, but it was horribly inefficient. I currently store my npcs in a linked list, and I was basically navigating through that list for each tile to see if an npc was there. I had the idea of instead going through the list once and storing each npc's position in a character array as their graphic, then checking the relevant position in the array for each tile that's in view. That would probably work, but then I thought about other things that might be there, like items or monsters, and what if there are multiple items in a tile, etc. Or just simply trying to get information about the npc in that tile. Surely there's a better way. Any suggestions?
Also, are there any good online resources for this kind of thing?
What about a std::multimap that maps the (x, y) location of a tile to the NPCs, items, monsters, etc. at that location? If you're already storing NPCs in a list, then you can map (x, y) to the iterators within your list. Something like:
// Contains the (x,y) location of a tile
typedef pair<int, int> TilePosition;
// Contains your NPCs
list<Character> npcs;
// Function that draws an NPC
void draw(const Character &c);
// Contains the locations for your NPCs
typedef multimap<TilePosition, list<Character>::iterator> LocationMap;
LocationMap npcLocations;
...
// Get the NPCs at (100, 200) and draw them
pair<LocationMap::iterator, LocationMap::iterator> range =
npcLocations.equal_range(make_pair(100, 200));
for (LocationMap::iterator i = range.first; i != range.second; ++i)
{
list<Character>::iterator j = i->second;
draw(*j);
}
You could also use a std:map that maps TilePosition to a secondary location which in turn contains all of the items that reside at that location.
EDIT: looks like a bunch of other people answered while I was writing my post.
I've been messing around again, and had a question. I'm using libtcod with C++, if it matters. This is regarding displaying tiles and the things that might occupy those tiles.
Don't use libtcod for tile graphics. It's a nice library to aside from that, but seriously, here is what I think is the main part of its image blitting code:
It's reading out every pixel of every image that you ask it to blit out individually, in software. They might have their reasons for it, but this is dog slow for any decent resolution or anything that would animate, even for a turn based game. I suggest you write your own tile renderer using proper SDL surfaces, pretty easy for top down perspective. Or if you're a champ you could rewrite their image blitting code to actually blit rectangular areas.
peterdevore on
0
Sir CarcassI have been shown the end of my worldRound Rock, TXRegistered Userregular
I've been messing around again, and had a question. I'm using libtcod with C++, if it matters. This is regarding displaying tiles and the things that might occupy those tiles.
Don't use libtcod for tile graphics
Well, when I say tile I mean in the... metaphorical? sense. I'm not using sprites, just straight ascii. Baby steps, here. :P
So my first step is rewriting what I currently have to use the List class (something I've been meaning to learn) instead of my own hacky node stuff. I'm kind of stuck. How exactly am I supposed to use member functions with it? Here is what I have:
list<Person> personList;
if(personList.empty())
{
personList.push_front(IDcount); //not sure if this is correct, was using "new Person(IDcount)" before
IDcount++;
}
for(list<Person>::iterator it=personList.begin();it!=personList.end();++it)
{
cout << "Name: " << *it.getName() << endl;
}
I get an error on the cout saying that the iterator has no member named getName(). The Person class does, but I'm not sure how I'm supposed to access it. Sorry for the newb questions.
-> is pointer notation. If you need to access members of a pointer, you'd use ->. If you need to access members for variables declared on the stack, you'd use .
Which is why:
(*myPtr).Method();
Is the same as:
myPtr->Method();
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
I've got a COM library already registered on a system, I did some changes to it, and now when I try to use a form builder and drag the COM library onto the form I get:
"OLE error code 0x80029c4a: Error loading type library/DLL."
It works fine everywhere else as far as I can tell, but I can't get it into drag/drop state that the other developer needs it for.
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
How would you go about writing a function that handles drawing some polygon (by user input) and then deciding what is inside the polygon and what is outside and automatically filling the inside area in with some color.
Lux782 on
0
KakodaimonosCode fondlerHelping the 1% get richerRegistered Userregular
I've got a COM library already registered on a system, I did some changes to it, and now when I try to use a form builder and drag the COM library onto the form I get:
"OLE error code 0x80029c4a: Error loading type library/DLL."
It works fine everywhere else as far as I can tell, but I can't get it into drag/drop state that the other developer needs it for.
Did you change anything in the COM library interface? And did you up the version rev on it? Either of those two will require you to re-reg the COM lib.
I've got a COM library already registered on a system, I did some changes to it, and now when I try to use a form builder and drag the COM library onto the form I get:
"OLE error code 0x80029c4a: Error loading type library/DLL."
It works fine everywhere else as far as I can tell, but I can't get it into drag/drop state that the other developer needs it for.
Did you change anything in the COM library interface? And did you up the version rev on it? Either of those two will require you to re-reg the COM lib.
I think this is the key. Really, any time you change a COM lib in any way you should go ahead and unregister the previous one, and register the new one.
Did that. Nothing's changed, I changed some logic behind the scenes. But now for some reason it won't register in the guy's foxpro application. I hate foxpro.
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
0
GnomeTankWhat the what?Portland, OregonRegistered Userregular
edited September 2010
Does FoxPro require to implement any crazy interfaces? Like implementing IDispatch directly? If you're using ATL, this should be done for you (if you used the right macros), but a raw, pure C, COM object won't automatically dispatch. I know VB requires it, so maybe FoxPro does too.
Posts
The worst.
It's good for programmers that can't program and need DB functionality. Like I said, access++.
I've only ever used mySQL at home, and Oracle and our proprietary B-tree garbage at work. I had heard mySQL doesn't scale as well as Postgre. Not that my home projects have any scale to speak of, but how true has this held for you?
e: I should add, I prefer MySQL over Postgre from a pure usability point of view. MySQL and it's tool feel very familiar to me after using SQL Server for so many years. Though the SQL dialect is more like PL/SQL (as much as something can be like PL/SQL), the GUI tools are very SQL Server-esque.
I agree on all points but the GUI tools. Because, umm...what GUI tools are you talking about?
I've used the query portion, and I wasn't a fan. The query editor is too small, unless you use the script editor, but then I didn't see a way to get output back from a query.
Does anyone happen to know where I might be able to find a large, downloadable database of recipes?
Or in general other good sources of open, downloadable database information?
I'M A TWITTER SHITTER
http://www.bea.gov/national/index.htm
The project I'm currently planning involves recipes, but I thought it would be a good idea to get an idea of what's available in general (in terms of publicly available datasets) for the future.
I'M A TWITTER SHITTER
http://www.gutenberg.org/wiki/Gutenberg:Feeds
It's bologna. For instance DAoC was built around it.
MySQL had speed, Postgre had "features." That gap is substantially closed in on. The largest reason to use MySQL? Pretty much everyone and their mom uses it for a LAMP setup. Postgre you have to go out of your way. Chances are if you need help, someone can give it with MySQL. Not so much so with Postgre.
I think Postgre's largest draw was stability and failover features. Not sure how much has changed as I don't keep on top of them anymore. But I do remember Postgre was the most stable of the SQL servers a few years back.
If you browse H/A regularly, you probably know that I occasionally mess around with game programming, typically rogue-like type games, and apparently do everything the wrong way.
I've been messing around again, and had a question. I'm using libtcod with C++, if it matters. This is regarding displaying tiles and the things that might occupy those tiles. I have a class for storing my map information that basically creates a large 2d array and stores various info relating to that tile, isWalkable, isTransparent, isExplored, etc. My render function centers the PC and draws the seeable tiles around him, and scrolls as the PC walks. I can draw the tiles fine, but now I've started trying to draw other things, like npcs and items.
I had npcs drawing fine, but it was horribly inefficient. I currently store my npcs in a linked list, and I was basically navigating through that list for each tile to see if an npc was there. I had the idea of instead going through the list once and storing each npc's position in a character array as their graphic, then checking the relevant position in the array for each tile that's in view. That would probably work, but then I thought about other things that might be there, like items or monsters, and what if there are multiple items in a tile, etc. Or just simply trying to get information about the npc in that tile. Surely there's a better way. Any suggestions?
Also, are there any good online resources for this kind of thing?
Steam Support is the worst. Seriously, the worst
That way as you hit the tile you can do a quick check, display them, and move on.
Yeah, mySQL has been an absolute breeze to set up, so I'm not going to use anything else for the foreseeable future. It doesn't hurt that every LAMP tutorial is mysql focused. Now I just have to figure out how to wrap mysqli in my own class to throw the appropriate exceptions.
I may end up doing that, but it would mean digging through a ton of code to find where they do it, and then trying to figure out how they do it. I'm not sure I'm quite up to that task yet, to be honest.
But what if there are multiple things in a single tile, like a an npc that drops all of his equipment?
Steam Support is the worst. Seriously, the worst
Linked list per tile.
You'd probably have something like linked list to items, single pointer to npc in your tile struct.
public class GameObject { //the base class for game objects //npcs, monsters, items, whatever } public class MapTile { public Image tileImage; public GameObject objectAtTile; } public static void main() { MapTile[,] theMap = new MapTile[25,100]; //do all the rest of your junk here //then you could do something like if(theMap[x,y].objectAtTile != null) { theMap[x,y].objectAtTile.Move(-1,0); } }That should be more or less what you want to do in that situation. Traversing through the list matching x,y combos could make that a much worse process than it has to be. I'd probably still keep the linked list for AI logic like I said, traverse it to see if you need to do any processing. Move an NPC, make a monster shoot a weapon, whatever. Then it could update the map itself on logic too, so you have two ways to do it.
What about a std::multimap that maps the (x, y) location of a tile to the NPCs, items, monsters, etc. at that location? If you're already storing NPCs in a list, then you can map (x, y) to the iterators within your list. Something like:
// Contains the (x,y) location of a tile typedef pair<int, int> TilePosition; // Contains your NPCs list<Character> npcs; // Function that draws an NPC void draw(const Character &c); // Contains the locations for your NPCs typedef multimap<TilePosition, list<Character>::iterator> LocationMap; LocationMap npcLocations; ... // Get the NPCs at (100, 200) and draw them pair<LocationMap::iterator, LocationMap::iterator> range = npcLocations.equal_range(make_pair(100, 200)); for (LocationMap::iterator i = range.first; i != range.second; ++i) { list<Character>::iterator j = i->second; draw(*j); }You could also use a std:map that maps TilePosition to a secondary location which in turn contains all of the items that reside at that location.
EDIT: looks like a bunch of other people answered while I was writing my post.
Steam Support is the worst. Seriously, the worst
I think bowen has the right idea for a solution. As for resources, I'm pretty sure I did some of these tutorials about 8 years ago: http://www.gamedev.net/reference/list.asp?categoryid=24#151
They're woefully out of date, but hopefully you can pick up on some of the methods that you can use.
Edit: You can use a list of pointers-to-object, and if the length of the list is > 1, display a nondescript sack or something.
I know I'm going to get corrections trying to write this off the top of my head, but here goes:
class Tile { protected: TileMapIndex tmIndex; std::vector<Entity*> entityPointers; public DrawTileContents() { GraphicIndex gfx; if (entityPointers.length() > 1) { gfx = GraphicIndex::MiscSack; } else if (entityPointers.length() == 1) { gfx = entityPointers[0]->gfx; } } }Edit 2:
God damn it, I need to post faster. Stupid job!
Don't use libtcod for tile graphics. It's a nice library to aside from that, but seriously, here is what I think is the main part of its image blitting code:
for (cx=minx; cx < maxx; cx ++) { for (cy=miny; cy < maxy; cy ++) { TCOD_color_t col=TCOD_image_get_pixel(image,cx-minx+offx,cy-miny+offy); if ( !img->has_key_color || img->key_color.r != col.r || img->key_color.g != col.g || img->key_color.b != col.b ) { TCOD_console_set_back(console,cx,cy,col,bkgnd_flag); } } }It's reading out every pixel of every image that you ask it to blit out individually, in software. They might have their reasons for it, but this is dog slow for any decent resolution or anything that would animate, even for a turn based game. I suggest you write your own tile renderer using proper SDL surfaces, pretty easy for top down perspective. Or if you're a champ you could rewrite their image blitting code to actually blit rectangular areas.
Well, when I say tile I mean in the... metaphorical? sense. I'm not using sprites, just straight ascii. Baby steps, here. :P
So my first step is rewriting what I currently have to use the List class (something I've been meaning to learn) instead of my own hacky node stuff. I'm kind of stuck. How exactly am I supposed to use member functions with it? Here is what I have:
list<Person> personList; if(personList.empty()) { personList.push_front(IDcount); //not sure if this is correct, was using "new Person(IDcount)" before IDcount++; } for(list<Person>::iterator it=personList.begin();it!=personList.end();++it) { cout << "Name: " << *it.getName() << endl; }I get an error on the cout saying that the iterator has no member named getName(). The Person class does, but I'm not sure how I'm supposed to access it. Sorry for the newb questions.
Steam Support is the worst. Seriously, the worst
Ah, that fixed it. Never knew that. Thanks.
Steam Support is the worst. Seriously, the worst
That's what -> is for.
Meaning it->getName()
This has always confused me. I generally know when to use . or -> but still haven't completely grasped why.
Steam Support is the worst. Seriously, the worst
Which is why:
(*myPtr).Method();
Is the same as:
myPtr->Method();
I've got a COM library already registered on a system, I did some changes to it, and now when I try to use a form builder and drag the COM library onto the form I get:
"OLE error code 0x80029c4a: Error loading type library/DLL."
It works fine everywhere else as far as I can tell, but I can't get it into drag/drop state that the other developer needs it for.
How would you go about writing a function that handles drawing some polygon (by user input) and then deciding what is inside the polygon and what is outside and automatically filling the inside area in with some color.
Did you change anything in the COM library interface? And did you up the version rev on it? Either of those two will require you to re-reg the COM lib.