Sign in to follow this  

Whats your suggest for API?

This topic is 4588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm going to code my own game, and we people always need something to begin from :P So I'm wondering what API do you guys suggest? I know c++ kinda well and so, the game gonna be a MUD (Multi user dungeon). The server is closing it's end of developing, thos we need a client that the users could connect though. I've tried Allegro but it seems to have slight problems with sockets and so, for networking. So if anyone of you know a good API that isn't too hard, please post here :) Thanks in advance, K-Zodron

Share this post


Link to post
Share on other sites
If you're just starting out, use the console to make a nice text-based game. Although it's not really exciting, it'll teach you the basics of the language as well as some nice programming techniques that are required for graphic programming.

Share this post


Link to post
Share on other sites
Quote:
Original post by Rob Loach
If you're just starting out, use the console to make a nice text-based game. Although it's not really exciting, it'll teach you the basics of the language as well as some nice programming techniques that are required for graphic programming.


Not really usefull as I know c++ and I have already once made a text based client
:O



But now I'm again thinking about that allegro, anyone knows some tutorials for it? <.<

Share this post


Link to post
Share on other sites
If you're making a MUD why are you even using Allegro? Unless you need lots of animated graphics all over the place you should be able to do everything you need with a normal Win32 GUI application, using C# (the .Net class library will provide everything you need for networking and GUI stuf) could be a good idea.

Share this post


Link to post
Share on other sites
Allegro is the 1337est API ever if you're going to start out. If you're making a MUD though, it'll probably be completely text-based, so don't bother with any specific API. When you want to get into 2D though, just go Allegro. SDL is silly (but also a great API).

-IV

Share this post


Link to post
Share on other sites
Quote:
Original post by TraderJack
SDL is silly (but also a great API).


Since there are probably quite a few SDL supporters, I would advise that you take the time to explain your reasoning behind this, in order to forestall any flamewars over SDL and Allegro (not that there are many; it's not like it's OpenGL and DirectX).

I like SDL better, because it's more consistent, and it looks more like a really simplified DirectDraw (or the graphics part does). Allegro was originally written for DOS, so that's one reason why I don't like it. I don't like it's coding style, either.

Share this post


Link to post
Share on other sites
Quote:
Original post by TraderJack
SDL is silly.
Any reason why? In my opinion, SDL is a better learning tool for beginners as its design is very staightforward and the documentation is more complete. I'm not saying it's a better API in general, just that it's a better learning tool. And yes, I've tried both graphics libraries out.

Share this post


Link to post
Share on other sites
Quote:
Original post by TraderJack
Allegro is the 1337est API ever if you're going to start out. If you're making a MUD though, it'll probably be completely text-based, so don't bother with any specific API. When you want to get into 2D though, just go Allegro. SDL is silly (but also a great API).

-IV


I don't know if hes joking or not... But I agree Allegro kicks ass. I think it all comes down to what level of object orientation you want. SDL is a much cleaner c++ interface(Can it even be usen in C?) Allegro has an almost completely function based layout. So I think it depends on your roots, C programmer like me will probably feel more at home with allegro whereas c++ programmer will probably prefer SDL. Atleast thats my take.

Share this post


Link to post
Share on other sites
Just a suggestion - but you could use a console app and DirectPlay for a MUD - I've used DP succesfully in the past and it's very easy to get the hang of - you really do not need any librabries that give you graphics support, as MUDs by their very nature do not contain graphics...

Share this post


Link to post
Share on other sites
Sheesh, just messin around you guys. I think the reason I would heavily recommend Allegro over SDL because there are so many resources (tutorials, open srouce projects, huge community) available that I never saw in SDL. By all means, SDL is a great API, an in no way inferior to Allegro, but with the Loomsoft tutorials to start you out, you can be up and running with some sample games in no time. It incredibally easy to learn, and I havn't encountered a single roadblock in all the time I've used it. Good luck!

-IV

PS: Did someone rate me down cause I said SDL is silly? I was just playin, lol (I think I lost 7 points).

Share this post


Link to post
Share on other sites
Well well, I'll go for Allegro I guess, already began some yesturday and it works kinda fine. Though getting some pure connection code for sockets is a pain in the ass with allegro <.<


Btw, what do you really mean with a "console game"? Like a Text based black screen or a black screen that starts a graphical type of a program?

Share this post


Link to post
Share on other sites
The reason I normally recommend Allegro is because it does useful things which SDL doesn't. Cleanliness of API, documentation etc, notwithstanding, these functions are provided by Allegro and NOT by SDL:
- Line drawing
- Circle drawing / filling
- Polygons
- Text output

Therefore it should be obvious to anyone who doesn't enjoy writing their own line / text etc routines, that Allegro is easier to use for this sort of thing. I particularly wonder how you're going to make any kind of MUD / adventure game without text output routines.

YES there are extension bolt-on libraries (of varying quality) for SDL which DO provide these things, but Allegro has it all in one box (Even if it is bloated, fluffy, hairy, mouldy etc, any other criticism)

Mark

Share this post


Link to post
Share on other sites
Quote:
Original post by markr
The reason I normally recommend Allegro is because it does useful things which SDL doesn't. Cleanliness of API, documentation etc, notwithstanding, these functions are provided by Allegro and NOT by SDL:
- Line drawing
- Circle drawing / filling
- Polygons
- Text output

Therefore it should be obvious to anyone who doesn't enjoy writing their own line / text etc routines, that Allegro is easier to use for this sort of thing. I particularly wonder how you're going to make any kind of MUD / adventure game without text output routines.

YES there are extension bolt-on libraries (of varying quality) for SDL which DO provide these things, but Allegro has it all in one box (Even if it is bloated, fluffy, hairy, mouldy etc, any other criticism)

Mark


Good to hear :P

But hey, is it possible to use "plain c++" inside the Allegro client, like start sockets etc.? (Last time when I included my "socket.h" the compiler gave like 500 errors on BITMAP*'s)

Share this post


Link to post
Share on other sites
There are some issues with Allegro and windows.h - this only affects Windows platforms, and is addressed in the documentation under "platform specifics".

It is not a major problem.

It IS possible to get around this, and include Allegro and windows.h (windows.h is a prerequisite for winsock.h)

Mark

Share this post


Link to post
Share on other sites

Just to expand upon what markr said, this is a quote from the FAQ that I think deals with your problem:


Q: I get lots of compile errors about conflicting types for "struct BITMAP"!

A: If your program directly includes Win32 API header files, see the "Windows specifics" section of the documentation. If your program only includes header files of the C++ standard library, you're very likely trying to compile it with gcc 3.x for Mingw32; if so, define the symbol __GTHREAD_HIDE_WIN32API on the compiler command line:
g++ -D__GTHREAD_HIDE_WIN32API program.cpp -lalleg



The other way to deal with this is to define the symbol yourself at the top of your header files:


#define __GTHREAD_HIDE_WIN32API

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Replace

#include
#include

with

#include
#include

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Anonymous Poster
Replace

#include
#include

with

#include
#include


So like...replace the same with the same? Awesome...

And thans guys, I'll try out that thing the FAQ said :P

Share this post


Link to post
Share on other sites
The anonymous poster was trying to say

Replace

#include <allegro.h>


with


#include <winalleg.h>


This is of course platform-specific - but then including windows.h would be anyway.

Another option which would work fine, would be to use allegro.h and windows.h only in separate compilation units (i.e. separate .c files).

Mark

Share this post


Link to post
Share on other sites
Okey...I got one more question <.<

I'm using size 640 460 for the screen, and it returns kinda cool, but I wonder if there is a way to make the background of sprites transparent? (So I won't notice the stupid pink background in-game, or whatever that color is xD)


Edit:

My little socket code doesn't really work, the client just freezes at this time :S

[CODE]
bool NETWORK::getServer(char ip[256])
{
unsigned int addr;
addr = inet_addr(ip);

hostEntry = gethostbyaddr(reinterpret_cast<char *>(&addr), 4, AF_INET);
if(!hostEntry)
return false;
else
return true;
}
[/CODE]

Anyone got an idea whats wrong? :P


Edit2:

Well seems like all my code in socket.cpp is f'cked o.O

[Edited by - K-Zodron on May 22, 2005 11:26:33 AM]

Share this post


Link to post
Share on other sites
I'd recommend SDL because for a couple reasons
-can use with openGL (mostly used for 3d apps but for 2d you could pull off some sweet effects)
-can use with openAL
-can port over directly to different operating systems

I've never really used allegro but thats just because I want to be able to use the really powerful apis with out having to worry about platform or os apis like the win32 api YUCK!!. I'm a portability freak I want to branch out past windows.

for transparent sprits try adding an apla channel.

Share this post


Link to post
Share on other sites

This topic is 4588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this