Jump to content

  • Log In with Google      Sign In   
  • Create Account

dilyan_rusev

Member Since 24 Nov 2006
Offline Last Active Dec 18 2014 05:28 PM

#5193401 Programming a website?

Posted by dilyan_rusev on 18 November 2014 - 03:42 AM

The classical resource for learning web technologies is w3schools (http://www.w3schools.com/). Start with the html5 and css3 tracks, then do the javascript track, as advised by alexw.

 

Then, you will need to learn frameworks that will make your life *a lot* easier. A must-know is twitter bootstrap (http://getbootstrap.com/). It basically eliminates the need to write your own css (but you still have to know how it works in order to tweak small things).

 

For simple sites, that's all you are going to need. If you need a little bit more complicated stuff, get familiar with XMLHttpRequest (https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest - mozilla's site is another great resource for web-related technologies) - this is the backbone of the modern web (in tandem with responsive design, which bootstrap will mostly handle for you). Then you may want to get familiar with jQuery/jQueryUI - do not learn it, just browse the demoes to know what is possible. The popular kid on the block these days for javascript is called anglular js (https://angularjs.org/), so you might want to learn that if you need more complicated web site (99% of people don't, although they they it might be kewl to sprinkle some useless crap to slow down their web site on slower smartphones, which are still prevalent). Still, it doesn't hurt to know what is possible with Angular.

 

This, mind you, is all on the client - defines the look&feel of your web site. The backend, however, is a different beast. ASP.NET MVC is a good start, since Microsoft have a ton of tutorials and it is easy to get started. If you don't like it, there's Django (if you are familiar with Python), Rails (if you prefer Ruby), CakePHP (if you are familiar with PHP), and.. I'm not a Java person, but I've heard of Spring. Pick the one whose programming language you are most familiar with and you'll find a lot of tutorials online.

 

Remember, you don't need complicated and fancy stuff just because everybody else is doing it.

 

Firebug is your best buddy for client web development :)

 

Now, these are more more complicated advices, so you might want to ignore them at first. Make your site work fast, make it work beautifully on smartphones/tablets via responsive design and don't overuse javascript. Web sites are fast if you do stuff with CSS, not Javascript, and also if you don't use AJAX for everything (if at all). Learn about bundling and minifying javascript/css, learn to use spritesheets with CSS for your images (if you are curious, look at the images in facebook). The goal, just like game programming, is to reduce the number of requests the browser makes to the server for files. The less files the browser has to download, the better. If something is static, put it in CDN. If parts of your site are static, cache them (different serves use different technologies to achieve this).




#5191671 Can't load .wav files with SDL

Posted by dilyan_rusev on 07 November 2014 - 08:51 AM

How do you run the project?

If it is ran from Visual Studio with (CTRL+) F5, then the working directory is the directory that contains the project file.

 

In any case, SDL requires you to have int main(int, char** argv), so what is the value of argv[0] when you run your program?

 

Edit:

And the obvious question: do youhave a file called "PlayerShot" (no extension) in that directory?




#5191500 XML vs Database

Posted by dilyan_rusev on 06 November 2014 - 05:45 AM

For storage, you can always use google protocol buffers.
 

SQLite, on the other hand, has the benefit of storing all your data in one file (zip can do that, too). However, unlike zip, SQLite allows you to patch (that is, add, delete and/or  modify items without rebuilding the entire file) that file in a relatively straightforward way. Contrary to what others have said, SQLite is an example of one of the embedded database engines. It is fast enough - you are not going to load from disk all the time, anyway.

 

I personally dislike XML and JSON, but they are fine if you are OK with the clumsy syntax. XML was never meant for humans to write (it was always meant for tools - with the benefit that humans can read it); since protobufs support both text and binary, I see no sense to write the code yourself. While JSON is terser, it still requires you to manually map the parsed tree to code.




#5190323 Why don't you use GCC on windows?

Posted by dilyan_rusev on 31 October 2014 - 04:12 AM

GCC doesn't support the Microsoft-specific extensions to the C++ language, runtime, linker and libraries which are needed for some of the Windows-specific technologies.

 

Clang is currently trying to be a drop-in replacement for C++ by implementing the compiler-specific behavior of cl.exe, but they are not there yet.

 

GCC used to be able to run some DX (8,9) code , but I don't know if they will ever support WinRT.

 

It generally makes sense to integrate as best as possible with the platform(s) you target, and to do that, you must use its native APIs. If they don't work with GCC, it makes no sense whatsoever to use GCC on Windows. Plus, Xbox One also uses a version of cl.exe, so this is additional incentive to invest in VS instead of GCC.

 

Edit:

About clang on Mac: for the similar reasons. Apple are pushing for clang, because it was built from the ground up to support IDE features. From what I understand, GCC wasn't very friendly to commercial IDEs by saying that if you want feature X, you have to open source your IDE (no static linking, no plugin system, everything is part of GCC). LLVM and company use much more liberal license, and clang was designed to be a drop-in replacement for gcc - it uses the same flags, it can use glibc, etc.

 

Since the tooling for Mac (XCode) depends on and uses clang, it makes no sense for most developers to use something else. If clang was the default on Linux distributions, you would use clang, not GCC.




#5188253 Switching IDE, having issue with "code completion"?

Posted by dilyan_rusev on 21 October 2014 - 12:15 AM

The MSDN documentation clearly states whether a C function or C++ functionality is Microsoft-specific or not. Different versions of the compiler support different parts of the c++11 and the upcoming c++14 standards.

 

You can easily use Visual Studio to work on a cross-platform project. You'd use CMake/premake4 for project generation, but unless you want platform-specific code, everything can be written in Visual Studio. It has better tooling than anything any other IDE I've tried can offer anything even close. Also, the Visual Studio's debugger is very, very good. For cross-platform projects, the most annoying thing for me is not related to the compiler, but that Windows implements Unicode via UTF-16 rather than UTF-8. The reason for that, like is the case most of the time with Microsoft products, is that they implemented Unicode support in NT when it was believed that 16 bits are enough to represent all people will ever need. Since Java was first implemented around that time, it is also one of the few tech stacks that do implement Unicode via UTF-16, as well.

 

The other two prominent C/C++ compilers - GCC and LLVM/Clang - also have non-standard extensions. Just look up POSIX, the libc is full of it. The fact that your Linux build compiles just fine with MinGW is only because the compiler is the same, not because it is more "pure" C or C++.

 

If you are one of the people that just doesn't like Microsoft, I would really recommend QtCreator and Eclipse CDT. Both work very well, and it is a matter of taste whether or not you like Eclipse. From what I understand, CodeLite uses clang for code completion, which means it must work very well and support C++11 (if using a recent version).  In case you actually do work on Linux, you can try KDevelop as well.

 

Generally, if you don't use Visual Studio, I advice you to use an IDE that integrates with clang. XCode uses it, QtCreator may use clang (wip/clang), KDevelop (5) is switching to it, there is a plugin (llvm4eclipsecdt) for Eclipse that uses it, CodeLite can use it. Clang was built from the ground up to support IDEs - with code completion, syntax coloring and refactoring. What is best, this is part of the compiler, so it understands the code very well and automatically supports new language features.




#5181559 .net framework text generator

Posted by dilyan_rusev on 19 September 2014 - 10:11 AM

Well, this is a game developer forum, but fine. I'm at work now, so this is a hackish solution, but it should work.

 

Please note that printing in Windows is complicated, so you'd better leave the job to some other control/tool.

 

The quickest and easiest way to print in Windows (generally) is to create a text file, then launch Notepad and tell it to print the file. This is not a perfect solution, but since you ask the question, I guess you need a quick solution.

  • Console.ReadLine() can read text from the console
  • File.WriteAllText() will write any string to a file
  • Process.Start() will launch an external program

To start Notepad in "printing" mode, you just do Process.Start(string.Format("notepad /p {0}", filename)), where filename is a variable that holds the file name.

 

In order to print text via API in Windows, you usually use a printing DC. You'll usually use a WinForms app to do that, as WinForms has nice wrappers for Win32. Here is a quick example on how to do that:

http://msdn.microsoft.com/en-us/library/aa287530(v=vs.71).aspx




#5154409 how to find specefic platforms sdk like p34 and xone?

Posted by dilyan_rusev on 18 May 2014 - 07:10 AM

This is a completely different topic. In my opinion, it is much easier to program for a console (except for the publishing part). You write it on your console and then it runs the same on all other consoles, for all your customers. So long as you don't depend on the Internet connection speed, of course. And with libraries like the DirectX Toolkit (https://directxtk.codeplex.com/), you can write almost as if you were using XNA.

 

With PCs, it is HELL on Earth. DirectX, OpengGL, different operating systems, different drivers, different installed programs, different versions of .NET and the C++ runtime... You can't even depend on good old Internet Explorer and Windows Media Player being installed anymore for EU PCs. And you have to test it like crazy, and then you *know* it's going to crash and be totally unplayable for some users because of some stupid combo you didn't think possible. And don't get me started on pirated Windows XPs that never got updated.

 

In this sense, I like what Steam are doing with SteamOS and their bare-bones Linux libraries & compiler.




#5154097 how to find specefic platforms sdk like p34 and xone?

Posted by dilyan_rusev on 16 May 2014 - 01:32 PM

AFAIK Microsoft does *plan* to make retail units as dev kits, but you still need dev kits.

 

We still haven't got through the whole process for Xbox One, but I can confirm that dev kits cost *much* less for indie developers than what Hodgman said. As a start-up, we can definitely afford it without any financial strain. Once you get approved, you will know more about the fees.

 

Just have in mind that the documentation is not what it could be for indie developers, so you have to maintain more active contact with Microsoft in order to know more and have more up-to-date information.

 

Also, we are all playing on the edge as to what we can and cannot say, as almost all that wasn't said the last BUILD is still covered by NDAs.




#5153976 how to find specefic platforms sdk like p34 and xone?

Posted by dilyan_rusev on 16 May 2014 - 05:30 AM

Just to clarify, for some of the consoles, as an indie developer you pay only for the dev kits, not membership. Which makes sense. Also note that some countries are not officially supported. Also, almost everything is covered in NDAs. This is why you can't get more answers, but actually getting an indie account for some of the consoles is easy, it just takes time and persistence.

In case you haven't come across the term yet, 'dev kit' means a console you can develop for.

 

I was going to say more, but @jbadams wrote his post before I got the chance to finish mine :)




#5152262 What is a good 2D game engine?

Posted by dilyan_rusev on 08 May 2014 - 03:51 AM

While I agree with Servant of the Lord, I would also share some experience.

 

Writing games that run on variety of computers is a pain in the ass. Unless you use GDI (and probably even then), you are going to be introduced into the Graphic Drivers Hell. I've used mostly Direct2D (and now Direct3D), and it is less than pleasant, because all the bugs DO NOT happen on your computer. So you are running around  the office telling colleagues "does this crash on your PC?", and then staring at the code and analyzing what could possibly go wrong with some other computer configuration. If you go down that route, make sure you've got damn good logging system (and that you log a lot because you might have to "debug" on a PC without VS).

You also mentioned C#. While I love .NET and C#, writing games in pure C# is a challenge - unless you use WinForms' GDI+ mapping or WPF (make sure you use at least ver 4, or you'll get familiar with NotifyPartitionZombie and other goodies), you'll have to interface with the OS in some way. And interfacing with DX creates a whole lot of problems. While projects like SharpDX make your life a lot easier, there are some inconsistencies, some things are more difficult in C# or require you to use unsafe code, or are plain buggy. Thankfully, SharpDX devs are awesome and fix things almost immediately, but there are surely problems awaiting in less used code paths.

Game engines like Unity, although tailored for people with completely different mindset than mine, handle all the unpleasant shit for you. With one awesome feature - with a few clicks you can build a Windows Phone, Android or iOS game. 




#5142602 SDL2, mingw64, and Code::Blocks

Posted by dilyan_rusev on 27 March 2014 - 09:30 AM

@dilyan, I think what you're saying is /manifestdependency and /DEFAULTLIB are options, and you're suggesting the fix is to remove those options (instead of trying to find alternatives)?

 

They are options (or command-line flags, arguments, parameters, whatever). Some of them I recognize as linker options. For some reason, you've got them passed down to your MinGW linker, and it complains that they are unfamiliar to it.

I do not recommend that you go back to Code::Blocks. This was intended as an answer to your original question, in case you were still curious.




#5142253 SDL2, mingw64, and Code::Blocks

Posted by dilyan_rusev on 26 March 2014 - 03:42 AM

If you still want an answer to the original question...

||Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='amd64' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|

If I remember correctly, MinGW follows UNIX standards, so options start with - and --, while Microsoft's tools follow DOS standards - so options start with /.

 

I'm not a command-line expert, but these seem to be linker options for Visual Studio's toolset. Go around Code::Blocks settings and get rid of them, if possible. If you can't find them, open the Code::Blocks project file with a text editor, find and delete them. This should fix the problem.




#5114505 SDL 2.0 setup un Ubuntu

Posted by dilyan_rusev on 05 December 2013 - 02:07 AM

Umm, no need for those things. AFAIK, most libraries in UNIX world either use pkg-config or custom libraryName-config programs to provide processor/linker flags. In the case of SDL2, I think the custom program is sdl2-config - i.e. running something like:

g++ file.cpp `sdl2-config --cflags --libs`

should be the preferred method on unix/linux machines, as it is portable. A more generic approach would be to use pkg-config:

g++ file.cpp `pkg-config --cflags --libs sdl2`

 

However, I would strongly recommend against compiling on the command line. It is a waste of time and productivity. Both Eclipse and QtCreator are great IDEs for C++, and you should use one if you want to focus on getting stuff done and not on compiling. If you are *really* intent on learning how to compile on linux, at least look up make files and normal build systems like cmake and scons.

 

A few tips on linux distributions: although library imports are generally named libNAME.a, you include them via their name only (-l NAME) - unlike Visual Studio. All libraries installed via the package manager (in your case, apt) go to /usr/include (in case you want to browse them manually). Usually you can execute shell commands and include the output of those commands in another command. That is why I've put accents (`) and not quotes (') around sdl2-config and pkg-config. Those programs print to stdout, but with the accents syntax you capture the output and put in in your command string. You can view documentation on C functions via the man command, e.g. man 3 printf would show you the documentation for printf. Some packages install man pages as well, but most don't. I haven't found the manual pages particularly useful for c++, though.

 

[Note: I don't have an ubuntu box atm and I haven't spell-checked the commands]




#5114013 Looking for the best Graphic Library to use with C# (No Xna Please)

Posted by dilyan_rusev on 03 December 2013 - 07:23 AM

I'd also second SharpDX - if you stick to the lowest possible versions of Direct2D/WIC and you compile for 3.5, your game's installer will basically copy-paste a few files to the target machine (Win7+, could work Vista if you lower the .NET version to 3.0). You no longer need to install the DirectX runtime & WIC, as they are is included in the OS.

However, programming SharpDX requires you to know a lot more about the underlying operating system, and on more than a few places - P/Invoke and Win32 mastery :) Also, what I dislike about SharpDX very much is that every HRESULT is mapped to an exception - even for some pretty routine failing conditions that shouldn't require try-catch blocks. Other than that, the combo of D2D + DWrite + WIC is quite good for 2D games.




#5096945 STL containers and constness

Posted by dilyan_rusev on 26 September 2013 - 06:26 AM

I would just advise you against too much forward-thinking. Code for 'now', because you can't possibly predict the future.

When (or rather, if) you need feature X, you will also need Y. And you will have a concrete use case to reason against. Then you will come up with much better interface.

If you still persist, I'd rather make the Mesh class itself a container, like Cornstalks suggested.






PARTNERS