cocon

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 342 total)
  • Author
    Posts
  • in reply to: Change the View Offset #15187

    cocon
    Participant

    I had some need about this a while ago.

    Trying to pan and zoom

    in reply to: ANDROID – FileStreams and reading .txt files #15186

    cocon
    Participant

    Perhaps it would be a good idea for Monkey to do an Assertion for notifying users explicitly.

    in reply to: Get the current language in device #15184

    cocon
    Participant

    Perhaps there would be a new need for a module be created called “Localization”.

    I have spent a few minutes creating a module to let you get the raw system locale (you will have to interpret it with custom rules in your program).

    Basically it depends on this: http://www.cplusplus.com/reference/clocale/setlocale/

    But of course the module will have to properly designed and planned so it contains various useful features and a reasonable API. We can throw a bunch of high level ideas and then use them as a placeholder for implementation.

    Attachments:
    1. localization.zip
    in reply to: Calculus #15183

    cocon
    Participant

    Looks very good.

    in reply to: New Realtime Sound Subsystem #15182

    cocon
    Participant

    wow, it’s getting better. 🙂

    in reply to: Reading the string with databuffer #15159

    cocon
    Participant

    It seems that there are various conventions on how to write strings.
    http://wiki.freepascal.org/Character_and_string_types#String

    The STRING+NULLBYTE is the Ansi String (what monkey has)
    The STR_LENGTH+STRING is the Pascal String (what the file format has)

    The problem was that I had not notice what sort of strings the file format used. I got inconsistent results among Monkey+C#+C++ because of not knowing the convention. :-S

    I can add simply a ReadPascalString method to the binary reader and close this. 🙂

    in reply to: Reading the string with databuffer #15152

    cocon
    Participant

    Oh so this means that CStringLength is the raw string format, right?

     

     

    Something else, I updated the code today but still it fails. For the sake of example, I coded the data generator again in C, this is as close as it gets to what the problem is. Monkey and C# might have been better design to avoid this confusion, but C is something different. I might have to do unicode conversion or bitshifting (null bytes might be bishifted to the other bytes).

     

    No more no less I captured the output in the screenshot.

    Attachments:
    in reply to: New Realtime Sound Subsystem #15148

    cocon
    Participant

    I don’t know exactly how these instruments are properly designed. I could guess that you would start looking at some VST plugins – some of them are exact replicas of 80s synths and that make them sort of standard. Otherwise there is a more modular approach that would allow the user to add the components together as building blocks.

    in reply to: Reading the string with databuffer #15146

    cocon
    Participant

    Buffer.PeekCString helps a lot because it stops when it detects the 0 byte.
    monkeydoc: Reads a null terminated CString from the databuffer.

    However PeekString is designed differently.
    monkeydoc: all bytes from offset until the end of the data buffer are read

     

    I tried as well PeekCString to see if it works but it gives the same number (which is 7 ).

    in reply to: Reading the string with databuffer #15131

    cocon
    Participant

    I looked at it further today and I found differences on how CSharp + Monkey writes the data buffer. However I found a better way to read the string (which works both fine for the C# data and the Monkey data – hopefully would be universal). It seems that PeekCString does the work fine however there was some trickiness involved in figuring out the offsets and lengths on how the string is peeked and the pointer is advanced.

    in reply to: Reading the string with databuffer #15119

    cocon
    Participant

    Otherwise if you want to test the default peek string method you would see some problems:

    in reply to: Reading the string with databuffer #15117

    cocon
    Participant

    after lots of testing i figured it out

    Attachments:
    in reply to: Game Management? #15114

    cocon
    Participant

    What I have been learning the past few months for architecture is that – it’s better to make clear cuts on the codebase early on and call them “subprograms” or “modules” or “libraries” and let them do their own thing have their own state.

    One great example is comes from using a physics engine (BEPU/chipmunk/box2d) where there is the World and you add Bodies. And therefore you can update the World (which updates all the Bodies) or having a reference to a Body you would control it (move it around etc). This you can call it a library. Another example is with the Audio engine contraption. Where you load a bunch of sounds in a list and then you simply call the play sound method. This you can call it a module.

    This approach is the “modular” approach which means is exactly what you would do in C where there are no classes etc. On the other hand if you go with an Object Oriented approach you code will be an endless  composite fractal which might give you confusion. So by expanding upon this idea you can simply let each subsystem do it’s own thing without mixing them all together.

    P.S. After studying the Doom 2 source code and other lots of C games – I have gradually reduced my OOP to exactly only where is essential.

    in reply to: Redshirt Fodder #15113

    cocon
    Participant

    This was really good. 🙂

    in reply to: New Realtime Sound Subsystem #15112

    cocon
    Participant

    Wow can’t wait to try it. I am a musician as well so I might be able to create a few things with it. 🙂

Viewing 15 posts - 16 through 30 (of 342 total)