Need help with MMOAA

BlitzPlus Forums/BlitzPlus Programming/Need help with MMOAA

neos300(Posted 2009) [#1]
Well, ive decided to quit blitz in favor of c++. Sorry.

However, while my network books are being delivered, i thought i would make a MMOAA(Massivly Multiplayer ASCII Adventure) in my spare time.

1. problem: I suck at Blitz graphics programming, and i certainly couldnt make a mmo client. I have however, made some succesful server tests, and could make a server and what not.

So, can anyone write a client for me? It needs:
1. Able to read an ascii file place the contents of it on the screen.(MULTILINED)
2. Able to make the maps in notepad(Again, multilined, will be ASCII art)
3. Have some gui of some sort.(Gonna be hard, as i have no experience with graphics programming i was unable to test writing values to a screen.

If anyone can help, please reply.


Sauer(Posted 2009) [#2]
I doubt anyone here will write you a client for a game without the server code at hand or any details about the game in general.

Just out of curiosity, what do you find easier about C++?


deps(Posted 2009) [#3]
1 You should look into (p/n)curses to place ascii text anywhere on the screen.
2 Google for "c++ load text file" or similar to load text files, then see 1
3 see 1

If you can't write the client yourself, you will most likely not be able to extend it further to suit your needs.


neos300(Posted 2009) [#4]
@Sauer
I dont. I find it a more diffucult and more powerful version of blitz.

@deps
I relaized this was a stupid idea when i posted it.


Mahan(Posted 2009) [#5]
Imho. you should try out BlitzPlus 2D programming for a while, because its unlikely you can find an easier language for 2D stuff. If you are 100% sure that you wanna do ASCII/console graphics I'd recommend http://www.freepascal.org instead because it has libs for that (and BlitzPlus does not).

But on the other hand if you wanna do ASCII instead of 2D as a fallback, I'd recommend against it. 2D is about as easy as ASCII (simple x, y coords on the screen) and you will get much more satisfaction with the results in 2D, with modern day standards.

If you want to learn it, I'd recommend writing a very simple game similar to Tetris, Space Invaders or even Lunar Lander. These games are simple enough to get your head around while learning programming.

I do not recommend C++ at all to learn programming from, because it's a very (very!) unforgiving language. C++ is very powerful, but with great power comes also great power to do things wrong, and in C++ a simple missing character in your source (like for instance a pointer-indirection) may mess up memory in a way where you get intermittent errors in different parts of your program, and these errors are sometimes extremely hard to track down, even for a professional.

BlitzPlus is really a simple language where its really hard to get memory/pointer type errors with the standard command-set so it's highly recommended.

Another 2D language (+lib) that is very very good and lean (and free) is http://www.python.org/ in combination with http://www.pygame.org/. But as always there are pro's and con's (compared to BlitzPlus):

Pros (Py compared to B+):
* Object Oriented Programming (in a very lean and safeguarded fashion)
* Very dynamic language (script based) so you can change about everything inside structures and objects at runtime (yes, even like add/remove fields from structures/types/objects)
* More libs available
* Free

Cons (Py compared to B+):
* Much slower than BlitzPlus. (in runtime)
* Less integrated.
* No default IDE. (there are a few very good ones but they are not easy for a beginner to setup)
* Harder to create .exe-files.
* No default F1-help for all commands (and not easy to setup for this)
* Compiled code in python (.pyc) can quite easily be decompiled.
* Might sometimes be more tricky to debug than BlitzPlus
* No centralized community. With BlitzPlus you got this community and here you will be able to get help with your problems with the language as a whole. In python you will have to go to different communities and forums depending on what lib you might have a problem with.

Since you already got BlitzPlus it's a very good starting point.

Always write a simple single player game first and get it working (!) before attempting MMO.

Before you attempt an MMO you need to have a bit of experience in the following areas (besides the simple 2d stuff):

* RDBMS design (relations and models, and how to optimize a model for the querys that must run fast)
* RDBMS <-> Object/Type state mapping and persistance
* Networking, not just 2 computers on a LAN, but how to make a stable server that can host 100s or 1000s of connections.
* Networking "part 2" how to efficiently pack/transmit states en masse. How to predict players movements/actions to smooth the game even tough there is a latency between two clients etc.

MMO has become a buzzword today, and lots of people try to make one as their first game project. This is a sure way to utter failure because MMOs are hard!

One natural step-by step ladder up the MMO road could look like this:

1.) 100% working simple single player game. Maybe 2D to keep things simple.
2.) 100% working simple networked game for just a few 2-4 players.
3.) 100% working small DB GUI-app, like for instance a mp3-collection manager with a few tables and relations (Song, Artist, Genre etc.) to get a hang of simple SQL and relations programming.
3b.) Rewrite the GUI app so it uses Object/Type mapping as a layer between the DB and the GUI
4.) Update the game from #2 to use a server with a DB to save/load the game (i.e. get a hang of storing a game state)
5.) Ahhhhh ... Grand MMO v 0.01 time!


However, while my network books are being delivered, i thought i would make a MMOAA(Massivly Multiplayer ASCII Adventure) in my spare time.



I wrote all of this because of this quote above. How long does it take for the books to get delivered? Like between 1-14 days right?

No one writes anything worth the title MMO in that amount of time(!) I know this is a harsh generalization but it's true for all us that are normal developers and not über developer gods. (I know there are stories like the one about the guy in the Linux?/BSD? community that wrote a working C compiler in 1 week just to show he could do it, but very few in the world have such mad skills and dedication)


Sauer(Posted 2009) [#6]
Yes I agree, Blitz is so great because you don't have to worry about "clean up", it has fast BUILT IN graphics, and the IDE is decent. Python is great to learn, but the IDE is crap and there's no easy way to distribute your programs. C is fast, but you only have one option for graphics (SDL) unless you want to learn DirectX or OpenGL programming. And even if you use SDL, you have to download a bunch of extension libraries, configure your IDE, and distribute all your programs with the .DLL's.


Luke111(Posted 2009) [#7]
Thing is, c++ is more memory conservant as for my memory.dmp copier should be written in c++ and it would do it faster. For the record - Nothing with the letter c in it is easier than blitz.


Mahan(Posted 2009) [#8]
@Luke111: First of all I guess you ment to reply to this thread: http://blitzmax.com/Community/posts.php?topic=86605

Second I think you will find, by experimenting a little, that when it comes to filecopying (writing/reading I/O) BlitzPlus will perform just as good as any C++ program (except in some special cases). This is certainly true for almost ANY I/O solution widely available on home computers these days. (The exception here would be extremely fast server-RAM or flash-based storage, but this is something that is mostly used on high-end server blades.)

Why is this? Because BlitzPlus release code runs (by my own modest estimates) about 3-10 times slower than a highly optimized C++ program, but home-user storage very rarely exceed 200Mb/sec. Even that requires a strip-able controller with 3+ parallel hard drives... and that is if you can do long sequential reads and writes. If you instead have 2 processes accessing that solution you'll see it quickly fall down to < 100 mb/sec because of "drive-head jumping time" (the trashing sound you hear when you copy several files at once).

So why won't file-copying be affected by the language speed? When writing/reading I/O we normally use buffer/block/bank commands. These commands are already implemented in C++ (or even assembler in some cases) under the hood. So when you copy a file you typically read blocks of 1-64Kb and write them back, using optimized commands to do the actual read and write, and thus the speed of the language issuing the writeblock/readblock is (almost) irrelevant.

Let be demonstrate this to you with a example:

IOSpeed = 200,000,000 ; this is I/O bytes/sec in a GOOD home storage solution.
BankSize = 4096 ; example copy buffer.

How many "loops" will the "copying language" have to make per second with this buffer size?

200,000,000/4096 = 48828.125

This is truly negligible! (Try to make an empty integer-loop in BlitzPlus 1 to 2,000,000,000 (NOTE: 10 times more than the number of bytes before) and you'll see that it takes ~1 sec on a modern computer)

As for the "memory conservant" thing: BlitzPlus compiles .exe's that include a "runtime lib" built into it. This means that the .exe's got a bit of size and you got a "minimal footprint" of a running program of about 5.5Mb. But after this initial "overhead" the program will normally (assumed we handle and free memory as we should) use memory comparable to any C++ program. 5.5 mb is also almost unimportant these days. If you installed a logitech-app for you webcam, you'll find it takes several times that ram alone. (and that is for a "taskbar-app"!)

Summary: Imho using C++ over BlitzPlus for file copying is in most cases totally worthless and a waste of time. It's similar to arguing that you need a ferrari and not a audi to go to your local supermarket :-)

EDIT: changed BlitzMax to BlitzPlus, coz that was what I was talking about.


GfK(Posted 2009) [#9]
If you can't get your head around Blitz, you've no chance in hell with C++.