Show Posts
|
|
Pages: 1 2 3 [4] 5 6 ... 13
|
|
61
|
Developer / Technical / Re: Nonlinear Coding
|
on: November 30, 2010, 05:33:37 PM
|
|
I will get a lot of flak, but I think the "code as linear text files" thing could stand to be at least challenged. All modern languages assume you are writing code on a typewriter, when clearly you are writing it in a multigigaflops-capable modern COMPUTER. I want an IDE that requires a dual core and a Radeon 3400 and puts that graphical power to good use.
I would like to see an IDE that has a graphical abstraction layer on a level of a modern AAA game titles.
Think about it. Let's say we have a hypothetical language whose code is EXCLUSIVELY organized into classes. Now imagine if every class of your code was a small tag, colored and shaped according to its characteristics. Now imagine if your project had a full 3d rendere that displayed your classes as a huge network of these tags, parallax-scrolling with class tags sorted by depth by some criterion or another, and the classes are interconnected with 3d lines which indicate inheritance and similar concepts. Naturally the grid would have depth fog, or water ripple effects, you could move the tags and organize them at will....
Now imagine that the 3d grid is sorted in layers and that every layer represents some sort of a hierarchy level, so for example all the graphics classes are on one screen. You could dive "into" the class hierarchy, zooming into the parallax network of tags, starting with a hypothetical "root" class, passing on by the major modules such as Graphics, Interface, Object Loader, etc.), through mid-level stuff (like Sprite, Entity, etc.) and arrive at your desired class (RenderSpriteInstance or whatever). You could navigate your code in 3d, and arrange classes logically and spatially - let's say you zoom out, see the entire code, remember your graphics stuff is on the left side of the "world", your AI is on the right, and your audio code is up and left and slightly deeper than the audio wrappers. Beats the fuck out of expanding the goddamn Solution Explorer.
Now, say you click on a class tag. It does not open a code window, but a hi-tech interface effect (think Crysis or Starcraft 2) expands it and presents a subwindow with a list of members and methods which are sorted not only vertically but also into side-by-side columns - sorted by you according to some specific criterion, like left column for public access methods, middle column for things that happen in the world, etc. No more scrolling through 5 pages of code to see your class interface! Comments are there all along, blur-blended behind the window and taking shape and focus when you hover your mouse over a method or property.
Then, clicking on a method would expand the subwindow with a "kaboom" sound and you could see the code for the method, but a keyboard button would make the code window fade out to 50% transparency and display tracing lines connecting every single identifier, class reference etc. in the code with their location on the 3d grid.
Anyone who thinks this is a lot of needless eyecandy shennanigans, please look at this scenario: Say you are working in a company with dosens of users prowling the code at once. So, why not use Modern Warfare-grade multiplayer sync technology to ensure every user sees every other user - perhaps as named pulsating wisps hovering over the class tag they are currently viewing. Someone with sufficient credentials could enter a class, lock it from others' interference (anyone nearby would hear it lock and it would get a huge padlock on it) and work on it; other programmers could hover above it waiting their turn. Then a project manager could open his IDE and see all the little wisps busily circling their class tags like so many worker ants, and walk his megawisp ominously between tags instead of between cubicles.
In the end you would still end up technically writing textual code divided into class files, i.e. doing what many IDEs let you do right now. But look me in the eye and tell me it would not be awesome.
|
|
|
|
|
63
|
Developer / Technical / Re: The grumpy old programmer room
|
on: November 30, 2010, 04:20:09 PM
|
Padding warnings are mistakes, but obviously ones so minor that you aren't concerned Well, that's my point. Byte padding is not a coding mistake in any way, shape or form. Classes should be written according to your needs. It is something the compiler does to align the data in a manner it finds more palatable and efficient. So it wants cSomething to take up 16 bytes instead of 13, cool by me. It can even warn about that in /Wall. But it is NOT a mistake. It is just something compilers do. Might as well treat name mangling as a programmer's "mistake" because he didn't manually mangle the names. I like my code clean and warning free. Some of the shit MSVC throws on /Wall is simply ridiculous. I only commented on all of this because you said, and I quote: "It's not the compilers fault you've made lots of mistakes, and not listened to it." That made me sound like some unscrupulous, undisciplined, untidy, filthy code hippie. Since I am obsessive-compulsive when it comes to code output, my code is warning-free according to the MSVC's default/recommended/actually sane level, W3, and only generates a single class of warnings on /W4 (which is not even recommended; to clarify, it issues a warning that an assignment operator cannot be autogenerated for classes that has a const member).
|
|
|
|
|
65
|
Player / General / Re: videogame BOOBS and you
|
on: November 29, 2010, 04:10:35 AM
|
I tried making my PnP NPCs like that - fleshing out the personality first, add a few random quirks by rolling on a table, and rolling for age and gender last - to avoid various age and gender related stereotypes creeping in on me. Didn't work.  . IT IS NOT MY FAULT SHE HAPPENED TO ROLL A NATURAL 20 ON HER BUST SIZE, PEOPLE.
|
|
|
|
|
66
|
Developer / Technical / Re: Choosing a programming language.
|
on: November 29, 2010, 03:59:15 AM
|
protected inheritance (sadly underutilized)
What do you use protected inheritance for? It's pretty useless in my opinion, usually being better addressed with composition. That quote is Average Software's. I don't use protected inheritance  .
|
|
|
|
|
67
|
Developer / Technical / Re: The grumpy old programmer room
|
on: November 29, 2010, 03:53:37 AM
|
You've made it effectively useless, by ignoring all your warning so far. It's not the compilers fault you've made lots of mistakes If you will treat every /Wall warning as a mistake on my part then I'm beginning to suspect that -Wall in gcc and /Wall in MSVC++ are completely different things. Very well, this seems an ideal topic to be having this discussion: How in the name of god is byte padding of my class a mistake on my part? Which good C++ programming practice have I broken by declaring a [non-multiple-of-four] number of booleans in my class? But that's just my classes. But here's what came with some c++ standard header includes, such as: 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocnum(133): warning C4710: 'std::_String_iterator<_Elem,_Traits,_Alloc> std::_String_iterator<_Elem,_Traits,_Alloc>::operator +(__w64 int) const' : function not inlined 1> with 1> [ 1> _Elem=char, 1> _Traits=std::char_traits<char>, 1> _Alloc=std::allocator<char> 1> ] 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring(383) : see declaration of 'std::_String_iterator<_Elem,_Traits,_Alloc>::operator +' 1> with 1> [ 1> _Elem=char, 1> _Traits=std::char_traits<char>, 1> _Alloc=std::allocator<char> 1> ] 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocnum(133): warning C4710: 'int swprintf(wchar_t *,size_t,const wchar_t *,...)' : function not inlined 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\swprintf.inl(36) : see declaration of 'swprintf' Thousands of these. Function inlining is fully left to the discretion of the compiler. If it does not see fit to inline swprintf, well, more power to it. But that's not my mistake and I can do nothing to prevent that from happening. If you meant I should put a #pragma warning disable in to shut the compiler up, then suddenly the mistake becomes paying too much attention to the compiler's silly inconsequential warnings. Argh! Which one is it? Can't have it both ways! Regarding debug, I figured since it has its own heap (I know because that's the reason it takes like a gajillion times longer to do memory allocations and deallocations, ugh), it clearly injects its own specific code somewhere. It might as well go the extra mile and take a bit longer to access array members to ensure an exception is thrown for buffer overflows. In addition to -wall, it can be very good to get into the habit of running a lint program on your code, once it gets above a certain size.
I'll definitely do that. Thanks for the tip.
|
|
|
|
|
68
|
Developer / Technical / Re: Choosing a programming language.
|
on: November 28, 2010, 07:15:58 PM
|
This really has nothing to do with OO. When you you add a private member, you change the size of the object. Any code that allocates an object of that type now has new memory requirements, and must be recompiled to allocate the correct amount of memory. Depending on where you declared the new variable, you may have changed the offsets of other variables, so code accessing those variables would be reading the wrong memory locations. Of course it has to recompile. I know that it is such a language that it HAS to recompile, because that's how it is made, which stems from its design, etc. etc. - and that's ok. The problem is you have to WAIT for that recompilation. Which brings us to... Most of the people I've seen that complain about slow C++ compile times don't understand good header writing techniques. You'd be surprised how far you can go with forward declarations. Of course, some just use a ton of templates, and there's really nothing you can do about that. Not saying it is cripplingly slow (although I do hear horror stories about large projects and hours-long compiles, ugh), but it is a tangible nuisance once your project advances beyond 30-odd .cpp files. And all the header discipline in the world doesn't change the fact C++ is the only language I've worked in where I got into the position to actually wait a substantial amount of time while waiting for a recompile to finish after changing a few things in the code. Now, I am a C++ man, I like the power it gives me, but this is a thread to help choose a programming language and for that reason I will point out its flaws as well as its advantages, as I perceive them. I made games in C++ and I made them in other languages and it's a completely different ballpark. Myself, I will gladly put up with some of its quirks and flaws because of what I get in return; that doesn't mean I'll shut up about them any time soon  .
|
|
|
|
|
69
|
Developer / Technical / Re: The grumpy old programmer room
|
on: November 28, 2010, 06:26:35 PM
|
Hm. Just out of curiosity, would that have been a compile-time warning in C# either? I am sorry, I should have phrased that better - I didn't really expect a compile time warning, although I suppose since I defined and accessed the array through numbers, such a bug could feasibly be detected at compile-time. I would definitely settle for a run-time exception, just like you said yourself. I realize realtime checks would slow down the code where a lot of members are called, but hey, isn't that exactly what the Debug configuration was made for? Do you have all your warnings enabled? (-Wall if you're on gcc)
Using Visual Studio 2010 here. While I don't expect the compiler to warn me about array bounds at compile time, you intrigued me to heighten the warning level to /Wall. It generated, no joke, 99788 lines of warnings. Virtually all of these are "unreferenced inline function removed" warnings and bytes padding warnings, and 99 of those come from headers I included from outside my project (stl stuff mostly I think). This means that even if the compiler was capable of giving me an array bounds warning at compile-time, it would be effectively useless because I would not be able to find it. It is of course possible this is abnormal and I am doing something horribly wrong with my headers. but a lot of stuff draws on my own "framework.h" which draws on <string> and some other stl stuff, and stl generates these warnings. If I am doing anything wrong please correct me.
|
|
|
|
|
70
|
Developer / Technical / Re: Choosing a programming language.
|
on: November 28, 2010, 03:01:46 PM
|
|
C++ has its share of problems. Compile times, for instance, are absurdly, inexcusably slow. As far as OO languages go, it could do a lot better (add a PRIVATE member to a class and watch dismayed as 30+ .cpp files need to recompile). It requires you to know what you are doing and you will likely spend some time learning things you wouldn't need to learn with other languages. It also happens to be extremely fast to execute, native, portable, and most important of all, stocked with DECADES worth of libraries for everything you might ever possibly need. If you're not going to abuse the shit out of available libraries, you can probably do better with some other language.
C++ is like this wonderful sophisticated sports car that can achieve 300 mph in 2 seconds - but it has a Space shuttle cockpit, you have to recite Shakespeare while you drive, the gears are shifted by contracting your pectorals in Morse code, and the steering wheel is situated below and operated by your left testicle.
If you don't absolutely need the road speed, you'd be a lot more comfortable and experience less testicular strain with a sleek C# sedan or even a bulky oldtimer like Java. Me, I already bought the racecar so I'll stick to it for better or worse. But I'll definitely need to give this newcomer Lua a spin or two around the block.
|
|
|
|
|
71
|
Developer / Technical / Re: The grumpy old programmer room
|
on: November 28, 2010, 02:55:26 PM
|
FUCKING C++ MAN REALLY AAAAAAAAAAARGH. Just yesterday I wasted an hour - or more - of my life and sleep trying to track why my code suddenly started throwing stack corruptions. Turns out I wrote a value past an end of an array by mistake during matrix identity. Something along the lines of: m[0][0] = m[1][1] = m[2][2] = m[3][3] = m[4][4] = 1.f; //where declaration is int m[4][4]; This is a FIXED LENGTH ARRAY whose size is declared and known at compile-time. The very same compiler which throws a hissy fit when I pass an integer screen width to a function that accepts floats not only allows me to write past end of an array but never utters a word of warning; instead, it crashes by throwing a heap corruption on a line at a COMPLETELY unrelated custom container template. It's 2010, people. I don't expect programs to write themselves but, goddamn, there is no excuse for having to put up with some of these things. Damn but C# is looking mighty fine to me at the moment, with its delicious, managed, seductive syntax and its voluptuous debugger. The slut.
|
|
|
|
|
75
|
Player / Games / Re: Why are there so few top-down 2D indie games?
|
on: November 21, 2010, 12:33:22 PM
|
|
Top-down is technically easier to execute but it appears very few people bother with it, and while I can't voice my reasons, given a choice between making a true top-down at a 90 degree angle and an identical game but with camera tilt, I will go for the latter even knowing the extra work it will entail. True top-down is difficult to achieve properly. If you're looking at a man all you'll see is a head and two shoulders.
Camera tilt somehow adds the illusion of the third dimension and some "realness" to the game even if your gameplay is completely 2d. Suddenly you can draw a little elliptical shadow below your character. You can have a tree with a sense of height. You can have nearer items occluding farther ones. Etc, etc. I am guessing it's what someone said back on page 1 - we are just not used to looking at people from a topside perspective.
Some things do look good in top-down format. I've played a lot of top-down space and airplane shmups, for example.
An exception would be GTA, which had a very good top-down execution, but that's probably because you spent most of the game in a car and could blow up pretty much anything.
|
|
|
|
|
76
|
Player / Games / Re: Minecraft is actually a TIGsource Scam (and also sucks)
|
on: November 21, 2010, 12:17:22 PM
|
That's why I asked what the point of the post was. Seemed to me it was a guy stating his opinion. I don't see anything wrong with that, and saw nothing wrong with Pixelthief's post. The consolidation of ranks that followed is admirable but questionable. Is Minecraft great? That's subjective, although in my humble opinion the popularity is not a fluke but well-deserved. But why is it suddenly wrong and pointless to point out an opinion - which happens to be that it doesn't have an overarching storyline and that it could use some improvement? I myself like it when games leave it up to the player to make up their own story. Some people might not.
|
|
|
|
|
77
|
Developer / Technical / Re: SFML Sprite - image not displaying correctly
|
on: November 17, 2010, 06:00:58 PM
|
I should probably try other formats but to be honest PNG seems like the best option to me, for its alpha channel and that. I didn't mean you should abandon .png, just that you might want to try saving a copy of this one image as a bmp. Then if it still behaves the same we know the problem is not format related.
|
|
|
|
|
78
|
Developer / Technical / Re: The happy programmer room
|
on: November 17, 2010, 12:55:12 PM
|
I posted the whole code pretty much, you should be able to fill in the missing functions yourself its just basic vector math Yeah, just the thing you posted was more than enough, I already have a class to take care of the math. I remember struggling with Bezier curves when getting my feet wet with polygonal level definitions - and I am 100% guaranteed to collide with it again, considering my future plans. I am arming myself for the inevitable, so to speak. Thanks a bunch!
|
|
|
|
|
79
|
Developer / Technical / Re: The happy programmer room
|
on: November 17, 2010, 11:46:33 AM
|
Mind if I swag this code, Glaiel? I will attribute it to you. In the comments. Read solely by me. Oh and also, I am happy because my AI scripting language/interpreter/VM appear to work, somehow. And I only missed one exam deadline to get it to that state! 
|
|
|
|
|
80
|
Developer / Technical / Re: SFML Sprite - image not displaying correctly
|
on: November 17, 2010, 11:41:14 AM
|
|
What format is the image stored in? I see it is a png. Could you save it as 24bit BMP instead and try it with that?
Also, what version of SFML are you using? This probably doesn't have much to do with it, but at least if it is 2.0 I might try to recreate the behavior. And I seem to remember having problems with pngs in 1.6.
|
|
|
|
|