Go Back   Angband Forums > RogerN

Conversation Between RogerN and jupiter999
Showing Visitor Messages 1 to 4 of 4
  1. RogerN
    November 18, 2012 02:34
    Source code should be heading your way. I hope the e-mail address is correct; I wasn't sure if the repetition in your address was intended or not, so let me know if you don't receive it.
  2. jupiter999
    November 17, 2012 05:59
    Yipee! Great to hear from you!
    You may send your sourcecode to this e-mail:

    But back to serious discussion, I'd been using PARGB32bpp format already since a few months ago (from an article found somewhere in
    So far I am facing a few problems as follows:

    1) Redraws the entire map for every movement (player's movement + monsters' movement).
    What goes awkward is when hundreds of monster moved one by one after player's movement. The game screen goes flickering on each monster's movement. Did you have this kind of problem?

    2) I need some delay in my drawing routine, so I use "Thread.Sleep" method. But then UI thread will be frozen by this, so after a long hours of trial and error with research, I used backgroundworker.
    But then my whole coding becomes a havoc to me. It looks to me as if OOP practices breaks down in my coding. I can't separate drawing routine away from my core game routines. So I end up wasting much of my time busy modifying the drawing routines instead of the more important game core routines.

    3) Caught exception "object reference not set to an instance of an object" from time to time. I'm still debugging it, but it seems to me that multi-threading codes started a few drawing calls that "fighting among themselves" to draw on the same bitmap variable. Still investigating...

    I'm totally taken aback when I saw you game runs, especially when the camp fire keep smoking on its own while I'm firing some monsters and others keep moving.
    It's brilliant!
    Everything is drawn smoothly.
    Fast, that I don't see any flickering whatsoever...
    By the way, are you doing a Windows Forms Application project or Console Application project?
    Really curious about this as well.

    I wish that my game core routines are portable, even for the drawing routines. But that will be my final objective, not now.

    Feel free to comment / suggest / advice me. Appreciate all of them.

    Best regards.
  3. RogerN
    November 12, 2012 05:13
    Sorry for the slow response - I didn't notice your message for a couple days. Sure, you're welcome to see the source code. To what e-mail address should I send it?

    If you haven't figured it out yet, the main trick to effecient bitmap rendering using GDI+ is to make sure that all your bitmaps are converted to the PARGB32bpp format. If you use any other pixel format then performance suffers a *lot*. With Malastro I don't worry about keeping track of which areas of the screen needing updating; it redraws the entire map for every frame of animation, but with the proper bitmap format performance is OK.
  4. jupiter999
    November 9, 2012 05:52
    Good day, RogerN.

    I'm totally in awe of your project: Malastro, especially it to be a C#4.0 project!
    I'm kindly request for your source code, because I'm also working on my own baby project in C#4.0 for quite some time ago. But I'm always having problems in UI (struggled for many months without promising result), especially game view rendering (bolt firing, icon animation, sprite drawing, etc.).
    I really appreciate that if you can provide the code of the project. But if you prefer not doing so, could you please enlighten me at least on how to do game view rendering, because I wish to do stuff like magical bolt / beam mechanism (especially when hundreds of magical beasts firing at each other), fast game map update when player moving around, etc..
    Truly appreciate your help, and thanks for the attention. Best wishes for your game, and good health to you~
    For roguelikes!

All times are GMT +1. The time now is 21:53.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.