In response to Ripiz
|
|
People are correct, this was a seriously bad example to compare complexity. That code isn't even really complex (more messy than it is complex); the only thing is that it calls a function that has many arguments. An identical thing can occur in DM, seeing as you could come up with procs that need various information and take lots of arguments. You can also have messy, long one-liners in DM too, but code length and its number of line(s) doesn't equal its complexity at all.
|
In response to Kaioken
|
|
True. But one of reasons why it's so long because it doesn't really have basics functions which BYOND does.
It's surely harder to load texture in C#:
backgroundHudTexture = content.Load<Texture2D>(@"Textures\HUD\HudBkgd");
In BYOND there's no need to load at all, we only set it, and it gets loaded and drawed automatically |
In response to Ripiz
|
|
That example is a little different. You could, of course, decide to write basic functions in a C-family language yourself and then use them as arguments (or include a suitable library).
It does indeed make DM easier to use, as you can see it as coming with a bunch of libraries already included that accomplish numerous things for you without needing to write them. But non-built-in things in DM can still be at least considerably complex, as implied previously in this thread relatively simple things to do in other languages can be surprisingly more complex in DM because it doesn't natively support them. Like displaying a random sentence (text string) on the screen; in DM it can require, if nobody minds the bluntness, pretty ridiculous operations and work, like first converting every character in a font to an image format (pretty much PNG/DMI), including them with the project, and manually drawing/building the images of the sentence, then displaying it in 32x32 chunks in the appropriate positions. Of course, we're only discussing examples here; obviously C++ can be much more complex than DM in the right situations, heh. |
if you think C++ is too complex... then, i would recomend you to try out XNA/C# is a balance beetwen powerful and easy...
Farther info here |
In response to Mobius Evalon
|
|
I take it you and Tiberath are a bit like Tom and Dan when it comes to brace placement. I sit on the fence personally, I'm not terribly bothered by either style.
|
In response to Stephen001
|
|
Stephen001 wrote:
I take it you and Tiberath are a bit like Tom and Dan when it comes to brace placement. I sit on the fence personally, I'm not terribly bothered by either style. I'm "on the fence as well," in that my brace placement follows neither extreme, though you could certainly say that I lean to one side a bit: if(boolean) I've never personally seen others' source code in which the else bit directly follows the closing brace in the way that I prefer. |
In response to Kuraudo
|
|
Usually that style is more synonymous with braces on the same line in general, in which case the opening else brace is also on the same line.
|
In response to Kaioken
|
|
To draw text in DM it's just loop every letter, add pixel_y offset and pretty much all.
In C# with XNA it's already included, so all is needed is to call function, for sure as I showed previously it has heck load of comments. As for locating stuff... C# XNA doesn't have view() function, it will have to be done manually. It doesn't know difference between turf, obj, mob. For C# XNA it's all texture and boxes, sadly. Making it hell complicated. But there are good things too, it can process stuff much faster than DM (when done properly). Sadly it doesn't have grid. Meaning stuff you draw, is current view based, not map based. So it needs huge lists to store every thing, then loop and draw only what is in view. But it needs to be done like only once. Once basic stuff is done it can be VERY similar to DM. For example, in DM to add something to screen we use
client.screen+=new/obj
Then specify location or something else. In my project (C# XNA) I made something similar: List<GUI> GUIObj = new List<GUI>(); // defines list In Draw() I loop list and draw every thing For sure it IS different. But in BYOND we can make it similar to lower number of lines and just call proc
DrawButton(client,3,3,"Ok")
In conclusion: If C# seems too hard when making game, make bunch of functions, lists and other stuff to make it more similar to DM. |
In response to Kaioken
|
|
Finding proper libraries for game related things has proven confusing to me. I will download it, and then not understand how to use it.
I thought when I download the library, it's going to be the source code of the library. But I find no such thing. I include it in the compiler, but can't FIND it so I can look through the new functions or whatever. Like with Allegro, I downloaded Allegro through the compiler, and included Allegro, but I can't FIND Allegro. My goal is just to make a topdown 2d rpg the likes of which you might see on the Gameboy Advance. |
In response to Ripiz
|
|
Yea. I was planning on making a bunch of functions to handle generic game things. But honestly, that will take me a long time due to inexperience with C languages since there is a lot of new stuff to learn.
Does anyone know of some kind of library or "game framework" source (that is actually not a piece of crap) that would include such generic things that MOST games need? Preferably one focused on 2d topdown games. I want to make a game, but I am annoyed that 90% of what I'm going to be programming in C++ ISN'T going to be part of the "gameplay" at all if you get what I mean. I am honestly surprised that any game programmer out there hasn't made a library of all the essential generic things a game (of a certain style) would need to get started, but I sure cannot find any. But yea, if anyone knows some simple 2d topdown C++ game source that will pass as a "framework" and isn't already too developed and complicated then point me towards it if you will. Thanks. My goal is just to make a topdown 2d rpg the likes of which you might see on the Gameboy Advance. |
In response to Stephen001
|
|
Stephen001 wrote:
I take it you and Tiberath are a bit like Tom and Dan when it comes to brace placement. I sit on the fence personally, I'm not terribly bothered by either style. Why do you even need braces in C++ anyway? It makes no sense to me. Why was tabbing not good enough? And why do you need ";" to signify a line break? Why doesn't the compiler already know you broke the line simply because, uh, it is? I understand needing to use a ";" to continue coding on the SAME line, but why at the end of a line that is already broken? And yet another thing, a function cannot be called if it is not defined literally -above- where you are calling it? That crap makes no sense. Why can't you just call the function anywhere once it's already defined? Why would it make any difference what place in the file it was defined at? These are serious questions if anyone can give me a serious answer. Thanks. |
In response to Nubtard
|
|
Nubtard wrote:
And why do you need ";" to signify a line break? Why doesn't the compiler already know you broke the line simply because, uh, it is? I understand needing to use a ";" to continue coding on the SAME line, but why at the end of a line that is already broken? Because unlike DM or some other languages, C/C++ doesn't (apart from a few situations involving strings and the preprocessor) care about line breaks or extra whitespace (tabs etc.) in your source code. So take a function written in 'standard' style: int test(int x) this is identical (to the compiler) as writing it without tabs: int test(int x) or even writing it all on one line:
int test(int x) { x = x * 10; return x; }
It's not just that these are equivalent forms of the same code; to the compiler, these three versions are identical. It's just a different way of formatting code; in DM (ignoring its ability to use braces too) whitespace and tabs are part of the syntax of the source code, but in C++ they are (almost always) ignored. As I said before, if you absolutely hate C++'s syntax (though frankly it should be the most trivial part of a transition from DM), you might look a Python instead which uses a newline/tab formatted source very similar to DM's. |
In response to Nubtard
|
|
C# XNA Framework is probably best choise, but it's not even near to being easy
|
In response to Hobnob
|
|
It seems like a lot more people would know how to program in C++ if they would have just made the compiler use tabs instead of {}'s and have it recognize line breaks on its own. And if it had a "standard variable" that could hold numbers and text of any kind instead of having to have int, long, double, float, char and so on variables that are only slightly different from each other and seem very inflexible.
If they just did what byond does, at least the code would make grammatical sense. And I really wish instead of the built in C++ functions having stupid names that in no way seem to relate to their purpose, they would at least have relatively self-explanatory names that at least correlate to some extent of their purpose. |
In response to Ripiz
|
|
Ripiz wrote:
C# XNA Framework is probably best choise, but it's not even near to being easy Yea it's on the top of my list of things to consider. Thanks to all who suggested that. If I actually make something worth playing at some point maybe I could make a little bit of money on the Xbox Marketplace. It -will- be a 2d "Gameboy Advance" style RPG, if it ever gets made in the first place. If I can bring my concepts to life like I did on byond then it should be no problem. XNA is the best thing I have heard about so far but I wouldn't want to jump to conclusions too fast. I am using Dev-C++ to practice some simple things. But it doesn't run right on my computer and that is slowing things down. |
In response to Nubtard
|
|
As Hobnob explained, the compiler simply doesn't read 'whitespace' (linebreaks and indentation). It ignores it pretty much like it ignores comments. Therefore, it requires a notation of specifying block and statement separations (which in DM and Python the notation is just the whitespace itself).
Isn't needing to include such extra notation in addition to whitespace for human reading less elegant, more distracting, and less effective overall in my opinion, as well as uglier? Why, yes, it is. |
In response to Kaioken
|
|
Kaioken wrote:
As Hobnob explained, the compiler simply doesn't read 'whitespace' (linebreaks and indentation). It ignores it pretty much like it ignores comments. Therefore, it requires a notation of specifying block and statement separations (which in DM and Python the notation is just the whitespace itself). I know it's asking too much but what I would prefer is a compiler that recognizes that if something is tabbed further than something else, it's as if it has the {}'s around it or whatever. So you don't need all these ugly {}'s everywhere in the first place. And that if something is on another line in the first place, unless preceeded by "\", you do not need to add a ";" to signify there has been a line break, the compiler should just know there was one because, THERE IS ONE. =P The most annoying thing of all though, is that a function cannot be called if used further up on the page of where it is defined, because it acts as if you haven't defined it yet. Also it would be nice if byond had a "developer chat" or something on the site. But oh well I prefer too much I guess. |
In response to Nubtard
|
|
Nubtard wrote:
It seems like a lot more people would know how to program in C++ if they would have just made the compiler use tabs instead of {}'s and have it recognize line breaks on its own. But this is actually the more common syntax, so your statement doesn't seem to make sense. Also, handling the syntax doesn't really amount to knowing to program. And if it had a "standard variable" that could hold numbers and text of any kind instead of having to have int, long, double, float, char and so on variables that are only slightly different from each other and seem very inflexible. You need to realize the difference between DM and C++'s scopes. C++ is a much lower-level language, and also compiles to executable machine-code instead of bytecode, and can be used for a broad amount of things (if not just about anything), so obviously things would need to be considerably different from a high-level, specific-usage-oriented and pretty much sugar-coated language. When going from DM you can see how awesome it really is, when it takes away most headaches from you and manages them itself. Though of course, it wouldn't be a problem at all for any/most language compilers to be able to support parsing indentation. Seems a little like people are trying to stick to the "good ol' way of doing things", since using indentation is factually superior to braces-syntax in some aspects, namely having the compiler and programmer reading the code in the same manner, and preventing the programmer from the double work in writing both braces and indentation (in order to preserve his sanity over time). |
In response to Nubtard
|
|
Nubtard wrote:
I thought when I download the library, it's going to be the source code of the library. Why would you even need the source code of a library? You are meant to use the interface/functions the library provides to interact with it. And these should be documented separately from the source code (e.g. on the website with Alegro). Nubtard wrote: I am honestly surprised that any game programmer out there hasn't made a library of all the essential generic things a game (of a certain style) would need to get started, but I sure cannot find any. That is your problem. You are looking for something "not too developed" in order to have a maximum design freedom, yet it should provide you with an easy implementation of exactly what you need. That is contradicting. |
Same-line brackets make Mobius something-something.