Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Mar 2007
Online Last Active Today, 03:04 PM

#5263090 Unity or unreal engine 4 ? For 2D

Posted by Amr0 on 22 November 2015 - 02:40 AM

You should start learning a programming language first. Both unity and unreal assume you know C# respectively C++.

The other way around, you won't get anywhere with either unity or unreal without knowing the programming languages they use.


Games of the level of simplicity that OP describes are not really that hard to make using only Blueprints in UE and without having to write code manually.

#5262869 Visual Studio includes a 3d modeller!

Posted by Amr0 on 20 November 2015 - 09:04 AM

If you want free 3D modeling software I would recommend Blender over all the others, I would even recommend it over most pay software.

Blender's UI sucks! Just saying.

#5261527 How do you plan your project?

Posted by Amr0 on 11 November 2015 - 05:04 AM

Ok so in the end I went with Workflowy. Here is my current project's plan/workflow. The reasons I went with Workflowy are:

  • Simple concept, easy to work with, intuitive. A point tree with drag-and-drop functionality makes sense for my intended usage. More so than cards (trello).
  • Can be used as a change log. Just move an item from the "TODO" list to the "Completed" list. The items in the completed list are grouped by the release version, so it's obvious which version brought which change.
  • Any point (and its children) can be shared with a link. This allows me to add links on the project's website to things like a change log, known issues, or the entire project's plan/workflow, and the information will be up to date without any further effort. It has two types of sharing links: view-only, and view-and-edit, so it can be used to work collaboratively with other people.

The free plan seems like it should be enough for my needs (250 points per month currently), but I wish it was more (there is a generous referral system in place though, but I always feel people who post referral links only want the gain and not to really share their experience with other people, so the links I posted here are not referral links). Also, it doesn't work offline.


OneNote is good, but drag-and-drop point lists are only supported in the desktop client (not the web interface), and you'd have to create a separate notebook for your project in order to share it with your users, because sharing a specific note is not supported.


In the end there is no single tool for all users needs and preferences. Just find something that gets the job done and doesn't get in your way and start working!

#5257869 Problems writing a BMP exporter

Posted by Amr0 on 19 October 2015 - 03:10 AM

A small thing:

//temp.r = i % 255;
temp.r = i % 256;

Sorry I don't have the time to have a good look at your code, but I wrote a "gdi memory bitmap" class a while ago, and it has a method which saves it to disk. You can find the code in this blog post, and below is the relevant method. I'm sorry for just posting code without useful answers, but I hope it helps.

// Desc: Save bitmap represented by the specified BITMAPINFO struct to a file.
BOOL CMemoryBitmap::SaveBMPToFile( const PBITMAPINFO pbmi, LPCTSTR sFileName, VOID* pPixels )
    FILE* pFile = _tfopen( sFileName, TEXT("wb") );
    if( pFile == NULL )
        return FALSE;

    INT nWidth = pbmi->bmiHeader.biWidth;
    INT nHeight = pbmi->bmiHeader.biHeight;
    if( nHeight < 0 )
        nHeight = -nHeight;

    INT rowSizeUnaligned = pbmi->bmiHeader.biBitCount/8 * pbmi->bmiHeader.biWidth;
    INT rowSize = DWordAlign( rowSizeUnaligned );

    bmfh.bfType = 0x4d42;    // 0x42 = "B" 0x4d = "M", says MSDN.

    // compute size of bitmap file.
    bmfh.bfSize =    sizeof( BITMAPFILEHEADER ) +
                    sizeof( BITMAPINFO ) +
    bmfh.bfReserved1 = 0;
    bmfh.bfReserved2 = 0;
    bmfh.bfOffBits = sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFO );

    if( 0 == fwrite( (VOID*)&bmfh, sizeof( BITMAPFILEHEADER ), 1, pFile ) )
        //g_Log( "Failed to write file info header!" );
        fclose( pFile );
        return FALSE;

    // NOTE: Some programs have problems loading bitmaps whose height is negative.
    // Therefore, this function will save the height as positive, causing the output
    // file to be vertically flipped.
    LONG oldHeight = pbmi->bmiHeader.biHeight;
    if( oldHeight < 0 )
        pbmi->bmiHeader.biHeight = -oldHeight;

    if( 0 == fwrite( (VOID*)pbmi, sizeof( BITMAPINFO ), 1, pFile ) )

    pbmi->bmiHeader.biHeight = oldHeight;

    // Now write the pixels:
    INT paddingBytes = rowSize - rowSizeUnaligned;
    DWORD dwZero = 0;

    BYTE* pBytes = (BYTE*)pPixels;
    for( INT y=0; y<nHeight; y++ )
        fwrite( pBytes, rowSize - paddingBytes, 1, pFile );
        if( paddingBytes != 0 )
            fwrite( &dwZero, 1, paddingBytes, pFile );
        pBytes += rowSize;
    fclose( pFile );

    return TRUE;

If I remember correctly, this code works with both 24- and 32-bit bitmaps, although you should always use 32-bit bitmaps since they are A LOT faster even if you don't need the alpha channel.

#5257544 Game Engine Editor

Posted by Amr0 on 16 October 2015 - 01:41 PM

Other than Qt, there aren't a lot of good UI sdks for C++.


There is Sciter. I've been using it for a few months now and I ABSOLUTELY LOVE IT! I used to use pure win32 GUI programming, and I know my way around it very well, but it's unquestionably unwieldy. Then I stumbled upon Sciter (can't really remember how), and I've in love with it ever since. I will never get back to pure win32 programming after this.


Sciter is an embedded HTML/CSS/Tiscript (like javascript) engine with a native C++ interface. It's lightweight, and once you get the hang of it, you will find it very much fun to work with. I switched my current project to Sciter, and honestly it saved me countless hours of work. My code is now even cleaner, with a clear separation between the UI layer and the application layer. Also it being free was important for me as a poor indie.


To get a feel of what it can do, just download the SDK and run the sciter.exe application to view some of the included samples. You will get tired before you finish seeing them all. Each sample is typically made of one html file which contains along with the html some styling and tiscript code. So if you know basic html and javascript, you'll be good to go with not much effort.


I'm not affiliated with it in any way, but I honestly think it's an awesome library that deserves to be much better known. It has just got a new website a few days ago, so you will find the community forums rather empty unfortunately, and the developer is still working on improving the documentation. But the library is quite mature and has been around for a good while now.


Good luck. I think working on an engine along with its editor makes much more sense than creating an editor as an afterthought.

#5255317 Drawing 2D Volumetric Lines (Without Geometry Shaders)

Posted by Amr0 on 03 October 2015 - 05:14 AM


Yay for posting pics. I wrote a small blog post quickly about curves in Curver, a program I'm working on currently. Unfortunately at the time I didn't have enough time to describe it in great detail, but maybe it will provide some insight. Click

#5255185 How do you plan your project?

Posted by Amr0 on 02 October 2015 - 11:31 AM


Personally I'm finding that having to go online to update the project plan on a daily basis (multiple times per day possibly) can be distracting.


And highly motivating!


We use Trello. We just don't over-architecture our Trello and keep it simple.



Do you mind sharing a link to your Trello board?

#5254746 How do you plan your project?

Posted by Amr0 on 30 September 2015 - 03:53 AM

I'm talking about personal / small-team project planning. For most projects, some soft of project planning is important. Project scheduling is also important, but usually more so for big teams / companies than small teams or lone garage developers. Often the two are integrated together. For a lot of people, project planning is just keeping a to-do list. Even more people just feel they know what needs to be done and just focus on working on what they feel needs to be worked on. Some people go for a to-do list with some extra functionality through software.


Describe how you keep track of tasks to finish and finished tasks, project scheduling (if any), what annoyances with your current approach, things you think would enhance it, how you share it with people (in case you do)... etc. Also, if you do keep a live project plan online, share the link here if you don't mind.


For consideration, following is a short list of software one can use for this that I've briefly researched in the last couple of days.


  • workflowy is basically a to-do list with drag-drop, tagging, and sharing (so that you don't have to maintain a separate change log) added in.
  • Trello is more complex. It's a to-do list with project scheduling and task assigning to members, with commenting and communication functionality. A trello board (basically project plan) can be made available for public viewing. I think it can be overkill for a small project for a single person, but maybe this can be said about anything except the last point in the list.
  • Evernote note. One can create a note with a simple bullet list and then share a link to the note on the project website for example. It supports lists with checkboxes, and also evernote works offline if you have the client. Signing up only for this particular use case can be overkill as well I think.
  • Notepad + text file in your project directory. Simple, quick, works offline, and can be placed right inside your project directory. Can even be made available online if placed in a cloud-synced directory. Unfortunately, working with the project plan can be daunting for anything but a simple 10-item list.

Personally I'm finding that having to go online to update the project plan on a daily basis (multiple times per day possibly) can be distracting.

#5246172 Code generation vs. Framework

Posted by Amr0 on 13 August 2015 - 04:04 AM

I created a framework for defining "nodes", which are objects that have input and output properties that can be connected together using a visual graph editor (similar to UE4's blueprint system). Defining a node type requires giving each property a name, a classification (input/output), a type, and "affects" relationships with other properties. Serialization is done automatically by the framework. Also, each node has a "Calculate" method which is invoked by the framework to update an output property when it's dirty (it becomes dirty when a property which "affects" it changes).


As soon as the framework was more or less functional I started defining some node types. An "Add" node which adds its two input properties and outputs the sum, a "MeshLoader" node which has an input string designating the mesh file name and an output property which contains the loaded mesh... etc. This very quickly became too tedious to be used effectively for anything consequential without lots of mindless typing. This could be somewhat alleviated with the use of macros, but reading your post, I immediately thought that using code generation could be a more handy solution.


I don't know what I'm trying to say... just what I thought of when reading your post.

#5241600 Working on C++ Visual Studio projects across multiple PCs?

Posted by Amr0 on 20 July 2015 - 02:57 PM

Or you could place your project (and dependencies) on an external fast hard/flash disk and carry that with you, although it's just a thought that I haven't tried personally.

#5216408 Help with parsing Maya obj files

Posted by Amr0 on 14 March 2015 - 03:07 AM

Also, check out my super awesome cool excellent superb not-just-maya-but-also-zbrush-and-more obj loader here: http://code-section.com/entry/13/cdx9-obj-loader-sample

#5214830 UE4-like shaders from materials (theory)

Posted by Amr0 on 05 March 2015 - 03:26 PM


Has anyone tried to implement similar system?


I have. It's a very intuitive way to work with shaders. The beauty of this is that you can design your nodes and shader structure such that the artists/users can customize exactly what you want them to customize, while maintaining control over the underlying structure of the shader, as opposed to generating the entire shader code only from nodes and requiring users to hook certain nodes in certain ways.


I am planning to work more on the system and release it as middleware for game developers so they can integrate it in their editors/pipeline/engines. Unfortunately I'm busy with another project currently. Here is a screenshot:




Some shader parameters can be dynamic and some can be "static". Changing a static parameter will require recompiling the shader, thus resulting in a new permutation of the shader. Another beauty of this system is makes it easier to create a platform-independent shader solution.

#5206570 Impossible to Detect Window Starting Unfocused? (Windows)

Posted by Amr0 on 25 January 2015 - 11:51 AM

My advice is not to worry too much about it - if memory serves, I've noticed this behavior in many titles. You start the game, nothing seems to happen, you click on something and then the cursor disappears. Users will know to alt-tab back to your game and then out to regain the mouse. But to lock the mouse to the center and hide it, you'd better do it after you capture the mouse, and you'd better stop messing with the mouse when mouse capture is lost. Windows will not let a background process capture the mouse, so maybe if you do it like that, users will not lose the mouse at all.


I'd leave it alone and maybe come back to it when the game is almost ready to ship. One thing you can do is load the "waiting" cursor at game start and restore the arrow cursor when loading is finished. That way, users will know the game is starting up and hopefully they will wait.

#5166011 Having a problem getting data from .obj file to render (index / Vertex buffer...

Posted by Amr0 on 10 July 2014 - 08:05 AM

Also, check my dx9 c++ obj loader sample if you'd like: click

#5162352 Visual Programming

Posted by Amr0 on 23 June 2014 - 10:12 AM

I love visual programming, and I think it can be a very empowering tool in certain cases, like empowering artists to create rather complex logic and complex shaders when designing levels and assets. But I don't think it would be easy to use it for general programming. One idea that comes to mind about how this can be achieved is by exposing the majority of the API of an operating system, like the Windows API, to the nodes system and allowing users to create a program using those node.


Anyway, I worked for a while on such a system for creating hardware shaders, but it is still not finished, and I put it on hold. I am intending to pick it up again. Here is a screeny :)