Bay 12 Games Forum

Finally... => Creative Projects => Topic started by: yamamushi on July 12, 2012, 09:35:36 am

Title: (First Binary Release!) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on July 12, 2012, 09:35:36 am
You may want to see http://roguebasin.roguelikedevelopment.org/index.php/The_ASCII_Project for a (hopefully kept) up-to-date summary of the project.

08/25/2012

As promised, for those of you keeping up with the project homepage, I have released a binary for Linux and OSX of the latest stable release of my Roguelike MMORPG project. The files can be found on our homepage.



Out of Date Information
Spoiler (click to show/hide)

You can find out more about the project at:

http://www.theasciiproject.com/ (http://www.theasciiproject.com/)



And for a small overview of what this project is "about" (although not entirely accurate as this was taken from the old project summary):

Spoiler (click to show/hide)


At this point, I'm the only one coding and working on the project to keep everything organized and easily accessible. So I am open to anyone who wants to contribute in any way, whether it be: Ideas, Feature Requests, Code Collaboration, Forum Moderation, Wiki Moderation, etc.

You can contact me here on these forums, the project forums, or via my email which is available on the project website.

Even if you're completely new to the world of programming roguelikes (or game development/programming) in general, I'm trying to keep everything easy to follow so that others can learn from my (many) programming mistakes.

The project is in C++, but I haven't relied too much on C++11 as the compiler support isn't really universal at this point in time.

Right now I'm in the long process of working out the kinks involved with a 3-dimensional FOV system in a 2-dimensional world. At the top of my (seemingly endless) list of notes is the to work out a proper system for handling floor tiles (entities are stored/rendered in a different way), as I am not too happy with the way I implemented them the first (well actually this is the 4th iteration of changes to them) time around.

Last night (or rather this morning, I'm a night owl) I implemented a way for all 65,536 characters in the Unicode 5.1 standard to be drawn on the screen. Combined with the 16+ million colors that are possible with libtcod, that gives us something around 1099511627776 unique characters to work with now.

Okay I'm rambling now, I'll just direct you guys to the website above for my devlog updates :p

Screenshot from early July 2012 in the spoiler below:
Spoiler (click to show/hide)

Update - 08/21/2012
Spoiler (click to show/hide)

Update - 08/06/2012 :

Spoiler (click to show/hide)

-Yamamushi


Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: MrWiggles on July 12, 2012, 09:38:47 am
So, how is this different from a mud? Beside graphical presentation.
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: yamamushi on July 12, 2012, 09:42:40 am
Well a big part of the reason I even came up with the idea for this project was because I couldn't find a MUD that suited my tastes :lol:

Over the coming weeks I would like to implement a "building" system similar to what DF has. I think the idea of people working together in an online roguelike to build houses and (potentially) cities is pretty exciting, and though some MUD's have "building" systems, I couldn't really attach myself to them with the lack of any graphics.

Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Normandy on July 12, 2012, 04:56:42 pm
As a former (and maybe current, depending on how next semester turns out...) member of the project, I wish you best of luck! I'll try and help out where I can, but after having spent the last couple of years coding in a just about every language that isn't C++, I can't help but feel a sort of primal fear every time I need to go near it.
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Skyrunner on July 12, 2012, 05:55:33 pm
Hmm.. I don't see why you don't use C++11, because most compilers *should* support it by now. The major ones do, such as Visual C++ Studio, or that expensive compiler with a fancy name that I don't quite recall.

As for the unicode thing, while I don't know about everything else, I'm pretty sure you won't be able to use the Korean characters in it xD

Anyhow, good luck. If ever a quick job pops up I might try my hand at it >.>
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: yamamushi on July 12, 2012, 10:17:16 pm
Unfortunate
Hmm.. I don't see why you don't use C++11, because most compilers *should* support it by now. The major ones do, such as Visual C++ Studio, or that expensive compiler with a fancy name that I don't quite recall.

As for the unicode thing, while I don't know about everything else, I'm pretty sure you won't be able to use the Korean characters in it xD

Anyhow, good luck. If ever a quick job pops up I might try my hand at it >.>

Unfortunately the GCC/clang compiler that ships with Xcode 4.3.3 on OSX Lion doesn't have support for Lambda's yet, and I'm afraid to see what else isn't fully supported. I suppose the main feature I want to use out of C++11 is Atomics, and most compilers have supported them for a while now.

Actually I do think there are quite a few Korean characters in the font set I put together too, U+AC00 - U+D7A3 and U+110x - U+11Fx are Hangul characters, and my bitmap font supports everything from U+0000 (technically an "invalid" code) all the way up to U+FFFF :D.


Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Skyrunner on July 12, 2012, 10:34:40 pm
The small_unicode.png only has the characters that are separate from each other.

If the unicode file you made is the font.png, I can't see anything D:


...Anyways, you won't need to use them anyways >.> Some of the squiggly characters look like they could be useful, though, like for..snakes? xD
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: yamamushi on July 12, 2012, 10:43:51 pm
The small_unicode.png font in there came from the libtcod forums,  though unfortunately it only has support for 11904 characters, and I wasn't happy enough with that :p

So I put together the "font.png" file, the reason you might not be able to see them is because they are white characters rendered on an alpha layer background. You could try opening it in a different image viewer, or perhaps dragging the image over a black background :) I had to do it that way so that the impact on the load time of the client would be minimal. And even at 1.8mb, it only added about half a second of load time to my startup :D
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Skyrunner on July 12, 2012, 10:51:17 pm
So that's why. :/
I'm away from my own computer for a while, and there's no Photoshop here.
Only Paint.
And everyone knows how efficient, feature-packed, exciting, powerful, and just dang useful Paint is. :P
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: yamamushi on July 12, 2012, 11:27:28 pm
I uploaded a new file into the "data" directory - "sample_full_unicode.png". It's rendered black on a solid white background, so you should be able to look at that without any problems :-)
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Skyrunner on July 14, 2012, 01:52:33 am
Do you know, by any chance, how to download a single file from git? I don't know how to, if it's possible, and downloading the whole archive is rather ... undesirable >.>
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: yamamushi on July 14, 2012, 12:55:38 pm
Hrm,

I'm not sure how you can pull down a single file (I'm rather new to git as well), so I uploaded the fonts to the website for you:

http://www.theasciiproject.com/fonts/sample_full_unicode.png
http://www.theasciiproject.com/fonts/font.png

:-)
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Skyrunner on July 14, 2012, 06:19:05 pm
How would you solve combat? o.O
Would you have a text screen portion where messages like The bear seems a little suspicious... scroll up?

Also, the Chinese characters are black and thickDENSE :P

I suppose the game is real-time, not turn-based like most roguelikes?
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: yamamushi on July 14, 2012, 09:44:30 pm
black and thick :P

lol.


The game is going to be real-time, however there will still be scrolling information messages about the environment and creatures and whatnot. However that information will be in a different portion of the screen, so that the chat portion of the screen isn't affected. Here in a couple of days, I may get around to implementing a very basic interface that will be used. The screenshots up on the website don't show any interface at all right now :(

As for combat, I want there to be simple controls as well as more complicated options kind of like what DF Adventure Mode offers. I'm sure it will need to be worked out a bit before there's a system that works well for all types of players in a rogue-like world online. It may work a little bit like how pvp MUD's work.

Because I want there to be large-scale battles, ie more than just a handful of players on the screen, the game is going to need to provide a way to do combat that doesn't cause people to die constantly due to its complexity. However I think when development on the combat mechanics begin, we'll already have people playing that will be able to provide needed input on what they'd like to see combat played out like.

The goals for this first development cycle are to release a client that will be able to connect to our server, or a server that players can run on their own, so that multiple people can interact on one map at the same time together.

Gameplay features for the first "release" (I don't really want to call it that) are to be able to move around on a map and dig out tiles and place them places to build things, kind of like a 2-dimensional early-version minecraft game. Players will also be able to move up multiple z-levels to build 3-dimensional things in a 2d game. From there I'll have a more fleshed out long term development plan, but my primary goals right now just involve coding the endless series of things in my notepad filled checklist to get to that first milestone.

I'm keeping everything completely open source so that people can add or rework things as they wish, and so that they can follow along with my development. I don't want this seem like vaporware, so it's important to me personally to keep the github updated with my progress as much as possible so that people know there is work actually being done on this project.
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Doohl on July 15, 2012, 03:40:31 am
This is a really interesting project and I'd love to see where it goes! If it's worth anything, I offer my help if you need it. I've worked with Libtcod and C++ extensively in a small roguelike I tried to make, but didn't really kick off.

I'm curious, however. Are you planning on taking the game towards a more Survival-y feel or traditional MMO running around towns and doing quests stuff?
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Sensei on July 15, 2012, 04:18:41 am
black and thick :P
Because I want there to be large-scale battles, ie more than just a handful of players on the screen, the game is going to need to provide a way to do combat that doesn't cause people to die constantly due to its complexity
Or a fast character creator :P
But seriously, if you want to encourage large scale combat, it's going to involve people dying constantly. You'll have to find a way around that to make it worthwhile- either a convenient respawning means or by not having people get too attached to their individual characters. Also, though exploitable, maybe do something like give players a bonus to XP when there's many enemy characters on screen.
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Reudh on July 15, 2012, 09:21:21 am
Posting to watch and offer two cents. This looks great so far!
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: yamamushi on July 15, 2012, 03:43:56 pm
This is a really interesting project and I'd love to see where it goes! If it's worth anything, I offer my help if you need it. I've worked with Libtcod and C++ extensively in a small roguelike I tried to make, but didn't really kick off.

I'm curious, however. Are you planning on taking the game towards a more Survival-y feel or traditional MMO running around towns and doing quests stuff?

If you're interested, I'm pretty easy to get a hold of (email or IRC or our forums). I can also run through the code with you so that you're not completely lost in my spaghetti code haha.

I'm leaning towards a more "Survival-y" feel initially, and if you read on you'll see why :p

You'll have to find a way around that to make it worthwhile- either a convenient respawning means or by not having people get too attached to their individual characters.

There will be permadeath, :-) But I'm leaning towards a system where new players are balanced with their skills. Players can increase a specific skill set by using certain abilities over and over (ie, fighters are probably not going to be architects). This makes it harder for players to become a "jack of all trades", and it also means that there are consequences for every action they take ingame. I also want this to extend to NPC's, so that if you kill the father of a family, he's not going to respawn overnight - That family's feelings towards you are going to change drastically, etc. etc.

Of course, like I said, there's going to be a lot of kinks to work out with the whole system. So we'll tackle these issues as they come along on the development path. :-)

Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: izak1399 on July 22, 2012, 10:20:28 pm
This is going to be so rad.
I'm no good with code. But I will definitely help play it. =P
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: yamamushi on July 23, 2012, 12:00:45 am
I'm one step away from getting networking right  :'(

Because my "tile" information is stored as a struct with a wchar_t in it, and because I am using "tpl" to serialize my structs to be packed onto a socket and sent over the net, I need to find a way to split a wchar_t* to a char* and back. Otherwise all the other data is getting sent over the net without any problems, it's just that pesky wide string that I need to deal with.

I'm hoping to have it worked out by the end of the night, and if not I'll have to resort to begging in ##C++ on freenode for help -sigh-.
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Skyrunner on July 23, 2012, 12:05:59 am
I'm still watching o.O
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: GalenEvil on July 23, 2012, 01:27:55 am
This is interesting. I am working on a project currently but I wish you the best of luck! I am not sure about a lot of the stuff involved with Roguelikes but if you need help with logic systems I might be able to help some. I am usually on every day or every other day. I have some experience with C++ though not a large amount.

I do most of my work on artificial intelligence systems. If that is something that you need help with, or just general pointers on how to approach an AI problem, I will do what I can to give ya a good answer.
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: Skyrunner on July 23, 2012, 07:58:39 am
So... do you have specific ideas planned out for things like weapons/equipment? Things like how you would handle, say, attack stats, or durability(if any), or quality.
Or how armor works, DF-wise (each item covers a specific area), or Rest-Of-The-World-wise (single defense stat).
Title: Re: Rogue-like (Unicode) MMORPG (kinda)
Post by: yamamushi on July 23, 2012, 02:26:17 pm
No specific ideas at this point, still trying to just flesh out the game engine and get everything running smoothly on the back end. Though if you have any suggestions, feel free to drop by our irc or drop a message in our forums :-)
Title: Re: (Update 8/6/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on August 06, 2012, 08:30:32 pm
I've made major improvements to the code since I first posted this, networking is now in place, and there are client and server build targets that communicate asynchronously over the internet (or any network, but that goes without saying). I'm handling all of the development by myself, so it's going to be slow progress getting the underlying engine running before I move on to the more interesting AI/Physics/Etc portions of the code.

I'm currently working on setting up a database back end (likely PostgreSQL), to handle the accounting for player accounts. Once I get that rolling and I cleanup the network caching (again..), I'll put the two pieces together so that players can create unique accounts on the public server and store their character information when they log out.

From there, it goes without saying that there will be a ton of underlying work necessary to get the players communicating and actually interacting with the game world. Such as destroying walls and building them, which leads into 3D (multi z-level) environments.... But all of that is in the coming weeks, it's a step by step process and I would like to get the primary engine components operating smoothly before I expand into gameplay mechanics.
Title: Re: (Update 8/6/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: Skyrunner on August 07, 2012, 04:04:15 am
Well, if you don't have specific ideas to handle stuff, I suppose I can help in that process. And I do know -some- programming, so I might be able to have a hand in actually implementing those, instead of being just an in-the-air Idea Man.

I'm wondering, how realistic do you want the combat, how realistic are you going to handle the objects ...?
Title: Re: (Update 8/6/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on August 07, 2012, 04:09:31 am
Well, if you don't have specific ideas to handle stuff, I suppose I can help in that process. And I do know -some- programming, so I might be able to have a hand in actually implementing those, instead of being just an in-the-air Idea Man.

I'm wondering, how realistic do you want the combat, how realistic are you going to handle the objects ...?


As for combat, I really haven't hit that point of the design decision process. Because I'm at the point now where I'm laying down network code and various other "base" issues with the engine, I feel that once I get these things in place I'll be able to tackle game mechanic decisions like combat/trade/health/relationships/crafting/etc with a better focus knowing that the implementation won't affect the underlying network/database code.

I do want fairly realistic objects however, but there has to be a fine line between realism and gameplay. As for a programmer, do you know any -shudder- php? or other "Web" language? If not it's fine, I was just hoping to get an API status script thrown together for the pub.theasciiproject.com public server page.

Shoot me a message or drop by the IRC if you have any questions/ideas :)
Title: Re: (Update 8/21/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on August 21, 2012, 10:05:12 pm
08/21/2012

A TON of updates to the game/project, and the version has been moved up to 0.0.0k (still an Alpha release).
Title: Re: (Update 8/21/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: Facekillz058 on August 22, 2012, 08:58:21 pm
This looks neat.
It reminds me alot of Haven and Hearth.

I might check this out some time.

EDIT: Oh, are there Polearms?

EDIT 2: And a quick question about the building mechanics. Are player built structures protected at all so people cant just come along and break everything?
Title: Re: (Update 8/21/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on August 22, 2012, 10:16:30 pm
This looks neat.
It reminds me alot of Haven and Hearth.

I might check this out some time.

EDIT: Oh, are there Polearms?

EDIT 2: And a quick question about the building mechanics. Are player built structures protected at all so people cant just come along and break everything?


Yes, and yes :-) ... Well, the real answer to the last question is "sort of", as it's a little more complicated than a straightforward yes or no. Suffice to say that a new player isn't just going to stumble by your home and be able to tear it down without significant effort :-)
Title: Re: (Update 8/21/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: Skyrunner on August 23, 2012, 02:54:26 am
I'd think it should take a whole lot of time for people to tear down stuff :P I mean, this isn't Minecraft--no-one's going to destroy a whole building with just a pickaxe xD

I'll just be lurking out of sight until you need or want ideas help :-0
Title: Re: (Update 8/21/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on August 23, 2012, 02:58:28 am
Well now that things are picking up, networking is working, etc.  I think it's time I reach out for community help...

I need artists and writers, a developer would be nice but I've been handling things and moving along fairly quickly even without an additional programmer committing base code.

Just this moment I completed a world-interaction system that allows players to dig and place tiles, so it shouldn't be long till a 3d world is in place and players can create "3d" objects....
Title: Re: (Update 8/21/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: Facekillz058 on August 23, 2012, 02:55:16 pm
Building protection or not, im looking forward to this game.

If you need any help brainstorming weapon ideas or the etc, holler.

If the code you use to set up weapons myself isnt too complex, I may even volunteer to code them.

I have a few more questions though.

In an ASCII Roguelike, how are you handling things happening in real-time?
Will there be crafting and resource gathering? I.E. Dig for iron ores, make iron bars, make iron sword/refine iron to steel?
How are you handling creating certain blocks, like, converting logs to planks?
Will building take a while to accomplish, like, a set amount of time to build X block into the world?
Will there be races other than humans that the player can choose?
Will this be free-to-play? It seems to me that hosting costs might pile up.
Will the game support tilesets?

I think a way you could handle building protection could be like.
Create Village Banner > 50 tile protection radius > Upgrade Banner > More protection.
There would need to be a way to make people who stopped playings' places raidable though.


This game has so much potential its not even funny.
Title: Re: (Update 8/21/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on August 23, 2012, 09:06:52 pm
I have the answers you seek and more, stop by our IRC:

http://www.theasciiproject.com/irc/ (http://www.theasciiproject.com/irc/)

or feel free to shoot me a pm or email here on the forums.

Some of the things, like real-time mechanics, have been detailed elsewhere in our documentation (our wiki : http://www.theasciiproject.com/wk/ (http://www.theasciiproject.com/wk/) ), and I am always looking for input and people to bounce ideas off of. That's how creativity flows :-)

If you tell me what you need, we'll put it in so you can start getting weapons made, perhaps a combat system?

Right now I'm working on the "3-dimensional" world, ie z-levels. I did the math, and at 16gb of ram or so, I can handle a 1 billion tile world heh (I have access to 96gb hosts). I don't think I'll be doing that though :p

I don't have a compiled version yet, so anyone who wants to help develop right now would either need to be running Linux  or OSX for an easy setup - as I'm not a Windows dev by any means so I don't really know how things are setup over there. We have someone who is supposed to be maintaining the windows branch, but none of the recent (past week and a half) updates have made it in yet, which is depressing because a lot of neat stuff has gone in over the past two days alone :D



Title: Re: (Update 8/21/2012) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: Facekillz058 on August 23, 2012, 09:51:19 pm
Well, I can already tell me coding the weapons won't work.
Mainly due to the fact that im on windows, and you said that developers and stuff need linux.
Also mainly due to the fact that modding weapons into DF is the limit of my experience.

Send me a PM if you want me to do any brainstorming for you though.
Title: Re: (First Binary Release!) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on August 25, 2012, 10:10:02 pm
Whew, it's been a long (almost) 2 months, but I'm happy to announce the first binary alpha release of The ASCII Project (ver 0.0.0m - Any Colour You Like). Unfortunately we only have builds available for Linux and OSX at this time, however a Windows build is in the works. If you're a Windows C++ dev with libtcod experience, or any experience for that matter, we ask that you stop by our IRC to help get the windows build out for everyone asap.

Downloads are available from our homepage:


http://www.theasciiproject.com (http://www.theasciiproject.com)
Title: Re: (First Binary Release!) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: Skyrunner on August 25, 2012, 10:14:16 pm
D: Why not Windows? T_T

I mean, like 80% of people use Windows... including me.
Title: Re: (First Binary Release!) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on August 25, 2012, 10:19:48 pm
D: Why not Windows? T_T

I mean, like 80% of people use Windows... including me.

Well that's why we need a Windows C++ dev asap to help out figuring out why wchar_t*'s aren't being translated properly, we think we've narrowed down the issue to that function, but someone with libtcod experience having eyes on this would really help as I only have Linux/OSX dev experience.
Title: Re: (First Binary Release!) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: Skyrunner on August 25, 2012, 10:26:16 pm
Hmm, though it says wchar_t is 2 bytes wide in Windows and 4 bytes wide in Linux, I don't see how that's problem...


I'm not that experienced, so I don't think I'd be of much help. D:
Title: Re: (First Binary Release!) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: Normandy on August 26, 2012, 01:18:45 am
Eep, actually using wchar_t*'s... C++ still gives me nightmares, y'know?

I have to admit I haven't actually looked through all your code carefully but what Skyrunner says might be the issue; wchar_t varies from platform to platform, so if at some point you're putting wchar_t's directly to a bytestream then if the server has one definition of wchar_t (4 bytes) and client has a different definition (2 bytes), then that'd obviously cause big problems.

Another thing I've gotten from a little bit of waffling around with the code is the strange combined use of wchar_t* and std::string. I haven't seen references to std::wstring (which would correspond correctly to wchar_t*), but I've seen a couple of wchar_t*. To me this seems like a miscommunication is taking place somewhere. Especially since wchar_t is platform-dependent, if these wchar_t*'s are translated into std::string in a platform-dependent way, this will lead to problems as well. Consider the following quote from Wikipedia:

Quote
"The width of wchar_t is compiler-specific and can be as small as 8 bits. Consequently, programs that need to be portable across any C or C++ compiler should not use wchar_t for storing Unicode text. The wchar_t type is intended for storing compiler-defined wide characters, which may be Unicode characters in some compilers."
(Source: http://en.wikipedia.org/wiki/Wide_character#C.2FC.2B.2B (http://en.wikipedia.org/wiki/Wide_character#C.2FC.2B.2B))

Unfortunately, I don't think there's much you can do about it without resorting to C++11's char16_t, which is apparently is still kinda wonky on most compilers (boost::locale doesn't have official support for them yet. And also libtcod doesn't have support for them). Or simply coercing the data into uint16_t's first then reconverting to wchar_t on the receiving end.
Title: Re: (First Binary Release!) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on August 26, 2012, 01:24:26 am
Well I was actually just talking in our IRC about the possible fix (I can't test it because I'm not on Windows), but I am 90% sure the breakdown is in this code:

   
Code: [Select]
    size_t size = lMap.size;
    wchar_t *wstr = new wchar_t[1];
   
   
    mbstowcs(wstr, lMap.ASCII, size);
   
    rMap->symbol = wstr;


Whereas it should be changed to:

Code: [Select]
   
    size_t size = sizeof(wchar_t);
    wchar_t *wstr = new wchar_t[1];
   
   
    mbstowcs(wstr, lMap.ASCII, size);
   
    rMap->symbol = wstr;

For proper portability.

The only reason wchar_t's are being used here is because of the way our serialization library compresses data, and that the tpl library doesn't support wchar_t* types, they need to be converted to multibyte characters first. After the raw data is sent across the net, it's unpacked correctly (we know this because the colors and tile placement information is making it across the net just fine), aside from the values of the wchar_t*'s.

Title: Re: (First Binary Release!) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: Normandy on August 26, 2012, 01:51:57 am
Hrm. Didn't look through the map code, and it's also pretty late here (should be getting to sleep!) otherwise I'd try the compile myself, but yeah, I could see that line causing some troubles. I feel like you should probably move away from using wchar_t's though. Chances are, assuming that you'll get 4 bytes then suddenly getting 2 will definitely lead to bugs in the future. Your seralization library is right in staying away from wchar_t's since they're platform dependent and won't serialize correctly.

I would imagine map tile data be stored as a series of integers (or smaller) that describe the type of tile and associated data - then the client decides how the tile should be rendered (i.e. what color and tile to use).
Title: Re: (First Binary Release!) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: yamamushi on August 26, 2012, 01:56:28 am
I would imagine map tile data be stored as a series of integers (or smaller) that describe the type of tile and associated data - then the client decides how the tile should be rendered (i.e. what color and tile to use).

I specifically chose against that type of design as to allow us to update the server and add new tile types without having to release client updates for every minor change to an entity we make on the server end :-)
Title: Re: (First Binary Release!) Rogue-like MMO / World Sim / Genetic Programming Project
Post by: Valid_Dark on September 02, 2012, 11:21:35 pm
Posting to watch,
I'm a semi-noobish C++ Developer, but I've no libtcod experience so I can't help you there unfortunately.
Maybe after I finish what I'm working on I can offer a hand with something though,