don't click here

PROSONIC IS NOW OPEN SOURCE

Discussion in 'Fangaming Discussion' started by saxman, Jul 16, 2008.

Thread Status:
Not open for further replies.
  1. Mastered Realm

    Mastered Realm

    Member
    3,830
    556
    93
    -
    Ok, this is a good feature (the Smart Mix thing) and yes, Sonic CD had the worst clipping effect in FM sounds and still was a good game. It took your time and intelligence to make this, if put the same effort on the rest of the game it will no be perfect but will not be far =P. Keep up the good work!
     
  2. saxman

    saxman

    Oldbie Tech Member
    Okay, I'm laying out some things I plan to do in the coming months. I don't know when the next release will be. There are too many things to do at the moment to determine how long it'll take.


    THING I PLAN TO DO #1
    ---- Background layer ----

    I had to take out the background layer for the 8-22-8 release, because I knew it would only make the engine perform even worse, especially for people who don't have newer computers. Now I still have the background layer coded, but the code is horrendous. I could post it on here to show everyone, but you'd never be able to understand half of what's written. I know I don't, and I'm the one who put it together! There's also some bugs in it, and certain features never did work exactly as they were supposed to.

    So, I've planned out in a little text file exactly what I want it to do and what possible features are optional (not absolutely necessary.) The background layer will still use "cells" as used in this video to achieve paralax scrolling. They'll be able to scroll horizontally and vertically, distort, and optionally be shown only at certain camera positions. These combinations allow for enough flexibility to do everything done in all three Genesis games, and then some.

    THING I PLAN TO DO #2
    ---- MMF-like scripting language ----

    I am studying MMF's event editor, and I'm drawing many ideas from it. I have brainstormed how the language will be structured and parsed. I'm designing it in a way that allows me to create software in the style of ClickTeam's event editor to do scripts. You could call it a rip-off sorts, but the event editor is easy to use without a doubt. It will be only be the second task I do, but it will also be the most difficult one of the bunch.

    THING I PLAN TO DO #3
    ---- Configuration file ----

    There's a lot of switches in ProSonic, but the only way to really access them is internally because they're hard-coded. So I think a configuration file will help people access these switches. It would allow things such as setting the resolution, frame rate, enable/disable Smart Mix, and some nitty-gritty stuff. I know this has been requested on several occasions, so it's something I have put on my list of things to do.

    THING I PLAN TO DO #4
    ---- Load data files from external list ----

    All the sprite/animation and sound files are loaded according to a list that is internal to the engine code itself. If people are to write their own objects or create their own music and sound effects, they probably want to be able to name them whatever they want. Therefore, I'd like to make some external files decide which filenames to look for. I may apply this idea to PZF files, but I'm kinda used to the whole "zone###.pzf" system at the moment, because it also allows zones to be automatically ordered by the engine without extra data needed to do that. But I'm open to suggestions, so if anyone has any input on what should or should not be done here, let me know.

    THING I PLAN TO DO #5
    ---- Animate block art ----

    I've wanted to do this for a while. I always knew I'd eventually have to do it, and so I'm making it a goal this time around. Ever since I transformed ProSonic from 8-bit color to 16-bit color, I've pondered what the heck to do about color animations and underwater palettes. There are several things I could do, but none of them are really easy to do or very flexible. My solution is to allow blocks to have animations. That way, if you need a palette animation, you can just update the block artistically rather than changing the palette. This is the easiest method from a programming standpoint, and it's probably easiest to grasp for game designers too, both experienced and inexperienced.

    THING I PLAN TO DO #6
    ---- Get water working ----

    Anyone who played the anniversary camera demo I released back in 2006 will know that water used to work, and it had distortion, raised up and down at identical pixel progressions, any all that jazz. It was my favorite part of the engine, mainly because of everything I did, it was the only sophisticated feature that was actually flawless. Since then, water has been taken out of the engine mainly due to the problems with 16-bit color.

    My decision is likely to be frowned upon by some who are dedicated to palettes. I feel most people don't like palettes. I don't like palettes either. My decision is to use a sub-set of block art for underwater portions. The downside is it'll eat up more hard disk space (it's not like a couple hundred kilobytes is a big deal anyway though), but the upside is newbies will get it. It's easy to grasp. I firmly believe this is the right way to do this at this time. The engine could always be expanded to support water palettes in the future.

    THING I PLAN TO DO #7
    ---- Add object layout editor ----

    This is a key component that was missing in the 8-22-8 release. There's no way to place objects in levels without a hex editor. So as one of the final things I plan to do before any release happens is to make object placement possible. I have been unsure how to go about it mainly because I need it to be able to interface with my engine at run-time.

    Yeah I could make it a seperate program, but in the past that has got me in trouble because whenever I'd change something major (perhaps a file format), I'd forget to change it in the other programs, and so I'd create more work for myself. Keeping it internal saves me headaches, and I think most people will like it being built-in. So I see it as a win-win.




    Now, I'd just like to review some things I've already accomplished since 8-22-8. I've talked about many of these before, and one or two I have not, but I like to review them in case anyone missed previous posts which seems to happen more than I'd like. So here we go:

    - BUG FIXES!! It took me a week to do it, and they were silly (but hard to find) bugs. I cured the engine of these, and it no longer spontaneously crashes

    - Major speed improvements! The first task I took on after fixing bugs following the 8-22-8 release was speeding the engine up. PZF files load faster than before, getting rid of the delay at boot-up and between levels. The drawing code has been entirely rewritten to be process on-screen information several times faster than the 8-22-8 engine release. I also recently put in an optional V-Sync to smoothen out the frames.

    - Advanced sound support! VGM files are supported as I've stated before, and WAV files can also be used. The Smart Mix feature makes it the engine's job to mix the sound rather than the game designer -- easy! Up to 4 (software) channels of sound can be used. The engine has a WAV logging feature -- that's mainly for my use, but I may keep it in for anyone interested. Currenly, jumping, spinning, spindash, brakes, death, and the ring chime are implemented. Rings alternate stereo channels.

    - Multi-player split-screen! Have 2, 3, or 4 players on a single screen. All of them are Sonic right now, but these players could be Tails, Knuckles, or anyone in the future. Net-play would be ideal, but I'm not planning for that right now.

    - Demo recording works flawlessly! Before, because of bugs, it wasn't entirely consistent. Now demos play the same everytime and don't crash the program either! Currently I have a demo sequence that cycles through 3 different demos, and pressing enter starts the game. It's mainly to show off the engine for people who have never actually played it before. At the end of a demo, it fades out the same way it does in Sonic 1 and 2.

    - New screen modes! Now the screen can be doubled in size like Kega and Gens. In addition, I made it so all the screen sizes can be viewed properly in full-screen. I'm providing for a very emulator-like experience.




    That should get everyone up-to-date on what's happening. I'm also taking a look into the Vista Aero issue that has been brought to my attention -- it has to do with security in Vista not allowing ProSonic to run while Aero is being used if the desktop isn't using 16-bit color. That's a problem. I don't know what I want to do to make it work with Vista without turning Aero off. I'd like some programmer opinions on this.
     
  3. Nibble

    Nibble

    Oldbie
    Sounds good. The MMF-like scripting sounds slightly ambitious, but hopefully it works out.

    I'm fairly certain it has nothing do with security; it has more to do with Vista's graphics architecture. Basically Vista no longer has DirectDraw acceleration, Allegro likes to use DDraw, but in many cases Vista can't show windowed DDraw apps without turning off Aero effects.

    Not sure if it's anything you can fix, other than by switching to something other than Allegro. I know that SDL doesn't have this problem, but it's also a lower-level library than Allegro; it just gives you a linear framebuffer and a basic blit function (and input and low-level audio). There are other libraries that draw 2D graphics with OpenGL acceleration, but that may be inappropriate for old-school raster effects.
     
  4. saxman

    saxman

    Oldbie Tech Member
    Hmm, well I read that this doesn't happen in the DirectX window is using the same color depth as the desktop. If this is the case, I'm wondering if I should do what Gens does and change the color depth used by Windows while ProSonic runs. This would only occur on Vista machines.
     
  5. Nibble

    Nibble

    Oldbie
    You could do that, but that's one of the main criticisms of Gens; people generally don't like it. To my knowledge, Gens is the only emulator that forces 16-bit color in windowed mode. Emulators that are still updated today don't force a bit depth on the user.

    Am I reading correctly that you think ProSonic doesn't run at all with 32-bit and Aero enabled? It actually ran fine for me; Vista just blanked the screen for a brief moment while turning off Aero, then runs ProSonic. When you exit, it goes back to normal. If you force 16-bit color, it would still give the user the same effect of a blank screen, so I wonder if it would do any good.
     
  6. Norym

    Norym

    Member
    11
    0
    1
    Changing Windows' color depth to 16-bit in Vista forces off Aero, so I guess the same thing would be happening with that method.
     
  7. Ultima

    Ultima

    Games Publisher Tech Member
    2,398
    1
    18
    London, England
    Publishing mobile games!
    http://www.allegro.cc/forums/thread/592011

    I'd check if the desktop colour depth is less than 16 bit, and if it is, set it to 16 bit, otherwise keep it the same. I don't know of anyone who uses 15 or 8 bit colour nowadays though, so it would be a minority of people who experience the bit depth change. All others would essentially be running the game in the native bit depth, which according to the topic should eliminate the issue.
     
  8. saxman

    saxman

    Oldbie Tech Member
    Looks like I misunderstood the Vista issue then. What if the program is using 24 or 32 bits of color, is that going to cause Aero to close out? If that is the solution, then I can apply a color conversion during the screen blit for Vista machines. I don't think it should hamper performance too much, especially since Vista machines are more likely than not going to be newer computers anyway.

    Also, just a few quick updates on some minor things:

    I had forgotten to mention a while ago I fixed it so you can actually use the close button on the window to stop the program. I've heard people ask "how do you exit this thing" over and over for the longest time, so I decided to apply the extra necessary code to make the close button work. Just throwing that out there while I'm thinking of it.

    As for what I'm doing now, I'm doing major revisions to the engine, optimizing the code quite heavily after being stunned at how horribly slow it was on my old Pentium II 400MHz machine. There's no excuse for only getting 40fps; it never used to be that slow. I can promise when release #2 happens, the engine will be MUCH faster than release #1. It already is, but as I said, I'm doing additional work in this area.

    The 7 point plan is still in effect though, so I'll let you know some news when I get some of the things on the plan completed.
     
  9. GasparXR

    GasparXR

    I'm back! Member
    I have a question, will be program eventually be designed to look like a modern application like MMF or Game Maker where all the functions are in toolbars, seperate windows for each editor etc.? I find this makes finding everything so much easier than having only keyboard shortcuts 80% of the time.
     
  10. Sappharad

    Sappharad

    Oldbie
    1,414
    70
    28
    Will it fit on a floppy disk?
     
  11. saxman

    saxman

    Oldbie Tech Member
    If you're asking if the program will have a GUI, the answer is yes. I experimented with a GUI I designed for my Kid Chameleon level editor, and although I didn't actually complete it, it did function alright. So I would like to take that same concept and bring it over to ProSonic to make accessing the various screens and functions much easier. I know people hate keyboard commands, but they have to understand too that it's all I have to do stuff with until a GUI is implemented. Though the GUI will not likely be implemented until sometime after the next public release.

    Truthfully, if you learn all the keyboard commands by heart and get used to them, the editing environment isn't that difficult. That of course will never fly with most people, but it's the truth.
     
  12. GasparXR

    GasparXR

    I'm back! Member
    Yes, that's what I meant, due to lack of sleep I forgot that it's called a GUI. =P
     
  13. I'm really looking forward to the next release! I myself would love an MMF-like scripting engine.
    What elements of MMF are you going to use in your scripting language?
    The only thing I can think of is events, like functions.. but with different syntax.
    And sorry if this has already been mentioned or something, but what will the syntax look like? I'd love C-like syntax.
     
  14. saxman

    saxman

    Oldbie Tech Member
    I have no set-in-stone details yet. I'm quite honestly a bit worried about saying too much yet due to what happened with the last release (people getting too excited and thus expectations being raised significantly too high.) So, I can only ensure you that I want to do something similar to what MMF does in regards to scripting, perhaps a point-and-click interface, etc. It's ambitious, but so was hacking Sonic games at one point. I believe it can be done.
     
  15. Don't worry about it too much. From what I've seen, you're able to do this... and even if not for the next build, I don't really care. I'm just looking forward to the next release in general. Even if it doesn't run quite as good as people expected...I think that you've done a great job!
     
  16. Conan Kudo

    Conan Kudo

    「真実はいつも一つ!」工藤新一 Member
    478
    1
    18
    Aero Glass generally will only run properly under 32-bit graphics mode. However, it also provides a slightly "murkier" 24-bit version of itself for IGPs. If it hits 16-bit mode, it will shut off and revert to Vista Aero Basic mode. The best way to solve this is to force the engine to automatically convert images from 8-bit and 16-bit color to 24-bit and 32-bit color. However, a few exceptions will still cause Aero to go down.

    Aero generally will go down if OpenGL SW or DDraw is used because they require more CPU power. Despite the claims that Aero is supposed to be mostly offloaded to the GPU, this is not true (However, this is not as evident in W2k8 and Win7). Aero does use quite a bit of CPU power, and this does not include the Vista compositor system (Windows Desktop Window Manager), which does offload quite a bit of work to the GPU. AllegroGL I believe does allow access through HW accelerated OpenGL, though it would probably be better if you can get it through a platform-independent way of accessing the primary GL systems on different OSes (Linux, Mac = OpenGL, Win32/64 = D3D) because if you can push through D3D, I *think* the Desktop Window Manager on Vista can be utilized to offload some of the work to the GPU directly, though don't quote me on it. In any case, it would be optimal to access D3D on Windows Vista while accessing OGL on Linux and Mac because D3D is the exception to this rule. Aero WILL NOT go down in most, if not all, cases when using D3D as the output for graphics.

    Disclaimer: These are my experiences with using various games and applications that required different modes compiled into a little informational post. YMMV and IANAE.
     
  17. saxman

    saxman

    Oldbie Tech Member
    UPDATES for MAY 2, 2009

    It's been a while. I haven't touched ProSonic in a while because of college work getting in the way. Understandably, my education comes first.

    Here is where I left off on my 7-point plan:


    #1 - Background layer:
    This is partially implemented in that it shows the background and handles certain variables to render the background dynamically. It handles scrolling speed, autoscrolling speed, scroll wrapping, conditions to show/hide layers, and image source copying. The last one is used to pinpoint an area on the background layer you want to use in the layer you're drawing. This allows you to do things like repeat areas of the background, draw layers directly in front of other layers, etc. All the variables are read from a data file inside the PZF archive and can be modified by the level designer.

    There's more I want to do, such as skewing and distortion filters. Both of these effects were used in the first ProSonic engine I did before the rewrite.


    #2 - MMF-like scripting language
    I planned some things out in a text file. I even started a program that I am thinking of using as the actual event editor. I'm still not 100% sure how to go about doing this, so it will be a learning curve for me. I may have to consult some people who are more experienced in this area to help me get through this step.


    #3-7
    Haven't had a chance to get to the other steps. I may do some things out of order for convenience, but I'm trying to avoid that if I can in order to disipline myself and get important tasks completed (like #2.)


    Misc changes
    I have improved Sonic's physics slightly. There were good before, but as seen in this video, the physics weren't perfect. Now the physics are closer to being perfect than they have ever been. In fact, I can run that demo, and Sonic will most certainly go up the ramp properly without missing! Rolling through Chemical Plant is no longer an issue, because Sonic now glides smoothly across all the slopes and loops. You'd be surprised how the tiniest changes make all the difference. I used my tracer program I wrote for Sonic 2 to track down what was going on in Sonic 2 that was different from ProSonic. That helped a whole lot.

    Other changes I have made can be read about on the previous page. I don't feel I need to repeat them since I have spoken about them once already!


    Private builds and eventual release date
    When I get through my 7-point plan, ProSonic will be ready for another public release. At the moment, I still have another week of schooling, and I've made a commitment to the S2HD team, so ProSonic will be on hold for just a little longer. I'm anxious to show off some of the work I've done. I think a lot of people will really appreciate how much better of an engine it is right now compared to the 8-22-8 release. That isn't to say it's near finished, but there are a number of very positive things happening with it.

    So anyway, I don't know of a release date yet. A SAGE release would be a goal to work toward, but I'm not releasing it for SAGE if my 7-point plan hasn't been completed yet. SAGE is such a good opportunity to promote, in that case, I may have to do something different for SAGE rather than an actual engine release. It all depends on how smoothly development goes between now and then.

    I will release several private builds to select people during development. Some people haven't got back to me on builds I've sent out in the past, and that's unfortunate. But I think I understand -- sometimes I ask and ask and ask, and I don't realize how much I'm asking of people, so sometimes I have to back off a bit. So I'm going to be a bit more open to who I send builds to. I don't want to send builds to people who are going to simply say "good job" and "yeah it works great" and never once telling me about any issues they run into or giving me any real details about what they think. I can get "good job" all day long, and I appreciate that, but it doesn't help me at all. So you potential testers out there, I'd like you to keep that in mind!
     
  18. Azu

    Azu

    I must be stupid. Member
    Awesome concept. Can't wait to see how you do the event editor. You might want to ask around Clickteam forums pr Sonic Fangames HQ.
    Generally anywhere where's there's MMF users.
     
  19. saxman

    saxman

    Oldbie Tech Member
    I got some stuff working. I have some really great ideas forming. I think this will turn out really sweet. Scripting for ProSonic made simple. This will almost certainly be the highlight of the next public release, and it could be made available just in time for SAGE. I'm hoping to send this out to testers soon.
     
  20. saxman

    saxman

    Oldbie Tech Member
    Some updates on the scripting stuff. These pics show that generating the bytecode works. Click the pictures below to show them in full-size...

    [​IMG]
    [​IMG]
    [​IMG]

    Most of the hard stuff is done already, so I'm expecting a bit of easy sailing from here. What do you think so far, does the scripting language look fairly easy to understand? Feel free to critique it.

    NOTE: I haven't done anything in regards to writing an "event editor" type program to generate these files yet. I'm saving that for later.
     
Thread Status:
Not open for further replies.