Recent Posts

Pages: [1] 2 3 ... 10
2
Nova and Mednafen cannot be trusted. (Especially Nova!)
If it works correctly in Bizhawk, SSF, and Yabause, it probably also works correctly on real hardware.
I do not know what else to tell you.
3
It does that in Nova and Mednafen, but in SSF and Yabause it loads correctly.
4
How do other emulators behave? (Bizhawk and SSF)

And if it ever appears, it is clearly getting into memory.
5
When I run my game emulating Saturn BIOS the map doesn't load. It appears and disappears. Anyone can help me?
Here's the code:
Code: [Select]
/*
** Jo Sega Saturn Engine
** Copyright (c) 2012-2017, Johannes Fetz (johannesfetz@gmail.com)
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**     * Redistributions of source code must retain the above copyright
**       notice, this list of conditions and the following disclaimer.
**     * Redistributions in binary form must reproduce the above copyright
**       notice, this list of conditions and the following disclaimer in the
**       documentation and/or other materials provided with the distribution.
**     * Neither the name of the Johannes Fetz nor the
**       names of its contributors may be used to endorse or promote products
**       derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL Johannes Fetz BE LIABLE FOR ANY
** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <jo/jo.h>
#include "sonic.h"
/*
** SPECIAL NOTE: It's not the Sonic that I'm working on, but you can now write your own :)
*/

jo_sidescroller_physics_params  physics;
static int map_pos_x = WORLD_DEFAULT_X;
static int map_pos_y = WORLD_DEFAULT_Y;
static jo_sound     jump;
static jo_sound     roll;
void            reset_demo(void)
{
    map_pos_x = WORLD_DEFAULT_X;
    map_pos_y = WORLD_DEFAULT_Y;
    player.x = 160;
    player.y = 70;
    player.angle = 0;
    player.flip_sonic = false;
    player.spin = false;
    player.can_jump = true;
}

bool          has_vertical_collision(void)
{
    player.can_jump = false;
    if (physics.speed_y < 0.0f)
    {
        physics.is_in_air = true;
        return false;
    }
    int dist = jo_map_per_pixel_vertical_collision(WORLD_MAP_ID, map_pos_x + player.x + SONIC_WIDTH_2, map_pos_y + player.y + SONIC_HEIGHT, JO_NULL);
    if (dist == JO_MAP_NO_COLLISION || dist > 0)
    {
        if (dist != JO_MAP_NO_COLLISION && dist < SONIC_JUMP_PER_PIXEL_TOLERANCE)
            player.can_jump = true;
        physics.is_in_air = true;
        return false;
    }
    if (dist < 0 && jo_is_float_equals_zero(physics.speed_y))
        player.y += dist;
    player.can_jump = true;
    physics.is_in_air = false;
return true;
}

inline bool      has_horizontal_collision(void)
{
    int         next_pixel;

    next_pixel = jo_physics_is_going_on_the_right(&physics) ? player.x + 4 :
                 jo_physics_is_going_on_the_left(&physics) ? player.x - 4 :
                 player.x;
    int attr = jo_map_hitbox_detection_custom_boundaries(WORLD_MAP_ID, map_pos_x + next_pixel + SONIC_WIDTH_2, map_pos_y + player.y, 4, 20);
    if (attr == JO_MAP_NO_COLLISION)
        return false;
    if (attr != MAP_TILE_BLOCK_ATTR)
        return false;
    return true;
}

void     sonic_collision_handling(void)
{
    if (has_vertical_collision())
        physics.speed_y = 0.0f;
    else
    {
        jo_physics_apply_gravity(&physics);
        player.y += physics.speed_y;
    }
    if (has_horizontal_collision())
        physics.speed = 0.0f;
    else if (physics.speed > 0.0f)
        map_pos_x += physics.speed < 1.0f ? 1.0f : physics.speed;
    else if (physics.speed < 0.0f)
        map_pos_x += physics.speed > -1.0f ? -1.0f : physics.speed;
}

inline void     camera_handling(int prev_y)
{
    int         delta;

    delta = JO_ABS(player.y - prev_y);
    if (player.y > 100)
    {
        map_pos_y += delta;
        player.y -= delta;
    }
    else if (player.y < 50)
    {
        map_pos_y -= delta;
        player.y += delta;
    }
}

inline void     my_draw(void)
{
    int         prev_y;

    jo_map_draw(WORLD_MAP_ID, map_pos_x, map_pos_y);
    prev_y = player.y;
    sonic_collision_handling();
    camera_handling(prev_y);
    if (!physics.is_in_air)
        sonic_running_animation_handling();
    display_sonic();
}

inline void     make_sonic_jump(void)
{
    player.roll = false;
    player.can_jump = false;
    player.spin = true;
    jo_physics_jump(&physics);
    jo_audio_play_sound_on_channel(&jump, 0);
}

inline void     my_input(void)
{
printf(0, 0, "caca %d", player.sdvel);
    if (physics.is_in_air)
    {
        if (jo_is_pad1_key_pressed(JO_KEY_LEFT))
        {
            player.flip_sonic = true;
            jo_physics_accelerate_left(&physics);
        }
        else if (jo_is_pad1_key_pressed(JO_KEY_RIGHT))
        {
            player.flip_sonic = false;
            jo_physics_accelerate_right(&physics);
        }
    }
    else
    {
if (!player.roll){
        if (jo_is_pad1_key_pressed(JO_KEY_LEFT))
        {
            player.flip_sonic = true;
            if (jo_physics_is_going_on_the_right(&physics) || jo_physics_should_brake(&physics))
                jo_physics_decelerate_left(&physics);
            else
                jo_physics_accelerate_left(&physics);
        }
        else if (jo_is_pad1_key_pressed(JO_KEY_RIGHT))
        {
            player.flip_sonic = false;
            if (jo_physics_is_going_on_the_left(&physics) || jo_physics_should_brake(&physics))
                jo_physics_decelerate_right(&physics);
            else
                jo_physics_accelerate_right(&physics);
        }
        else
            jo_physics_apply_friction(&physics);
}else{
            jo_physics_apply_friction(&physics);
}
    if (jo_is_pad1_key_pressed(JO_KEY_DOWN) && (int)JO_ABS(physics.speed) >= 4){
    jo_audio_play_sound_on_channel(&roll, 0);
            player.roll = true;
            player.spin = true;
}
    if (jo_is_pad1_key_down(JO_KEY_START))
        reset_demo();
if (!player.duck){
    if (player.can_jump && jo_is_pad1_key_down(JO_KEY_A))
        make_sonic_jump();
    if (player.can_jump && jo_is_pad1_key_down(JO_KEY_B))
        make_sonic_jump();
    if (player.can_jump && jo_is_pad1_key_down(JO_KEY_C))
        make_sonic_jump();
}else{
    if (player.can_jump && jo_is_pad1_key_down(JO_KEY_C)){
player.sdvel += 2;
    jo_audio_stop_sound(&roll);
        jo_audio_play_sound_on_channel(&roll, 0);
        player.spindashing = true;
}
}
if (jo_physics_is_standing(&physics)){
player.roll = false;
}
}
}

void load_map(void)
{
    jo_sprite_add_image_pack("BLK", "BLK.TEX", JO_COLOR_Red);
jo_map_load_from_file(WORLD_MAP_ID, 500, "MAP", "DEMO2.MAP");
}

void load_background(void)
{
    jo_img      bg;

    bg.data = JO_NULL;
    jo_tga_loader(&bg, "BG", "BG.TGA", JO_COLOR_Transparent);
    jo_set_background_sprite(&bg, 0, 0);
    jo_free_img(&bg);
}
void            load_sounds(void)
{
jo_audio_load_pcm("JUMP.PCM", JoSoundMono16Bit, &jump);
jo_audio_load_pcm("ROLL.PCM", JoSoundMono16Bit, &roll);
}
void jo_main(void)
{
jo_core_init(JO_COLOR_Black);
    jo_printf(0, 29, "Cargando...");
    load_sonic();
    load_background();
load_map();
load_sounds();
    jo_physics_init_for_sonic(&physics);
    reset_demo();
    jo_printf(0, 29, "Sonic Saturno 0.5");
jo_core_add_callback(my_draw);
jo_core_add_callback(my_input);
jo_core_run();
}

/*
** END OF FILE
*/
6
Feature Request - Animated Color Palette - Color Cycling/Palette Shifting

Currently when creating effect of animated texture it is usually necessary to store multiple frames of animation,
causing increased memory usage and resulting in animation that is not smooth if there are not enough frames.

I would like to request following feature: Animated Color Palette - Color Cycling/Palette Shifting.

This technique allows you to create complex and smooth animations of things like for example fire or flowing water,
but it only swaps/animates color palette, and pixels of picture/texture remain unchanged(in other words, there is
only one picture), and seems to be intended for very limited hardware.

Following links give example demos of such technique, including animation of full day and night cycle
(click "Show Options >>" to see color palette cycling):

http://www.effectgames.com/demos/canvascycle/
http://www.effectgames.com/demos/worlds/

FAQ > Color Cycling 8bit Art:
http://markferrari.com/faq/color-cycling-8bit-art/

GDC Presentation by author discussing use of this technique:
https://www.youtube.com/watch?time_continue=2&v=aMcJ1Jvtef0

Please let me know about feasibility of adding this feature.


7
Project announcement / Re: Sonic Z-Treme
« Last post by corvusd on October 01, 2018, 06:16:31 pm »
8
Project announcement / Re: Sonic Z-Treme
« Last post by XL2 on September 30, 2018, 03:29:08 pm »
I already create quads, but sometimes it's impossible (like the area next to the flowers).
My solution will be to flag these objects as entities instead to avoid subdividing the map.
It should lead to very few subdivisions.
I also have a scoring system where subdivisions are to be avoided when selecting splitting planes.
About open maps, it's a huge concern and the portals might not even work.
I don't care that much since I want to focus on my fps game instead, so maps such as Quake maps should work fine.
But it's still a long way to go before I can test it on real hardware.
9
Project announcement / Re: Sonic Z-Treme
« Last post by corvusd on September 30, 2018, 12:54:22 pm »
An amazing job XL2!

From what I see of the image that you have shared, and the theory of the tutorial. It is a technique very oriented to closed scenarios, with rooms and with the basic primitive of the triangle.

I understand that it may be difficult for you to implement the BSP tree for both SS, primitive and open levels by levels like this of the Sonic.

I can think of a few suggestions, to see what you think:
1) Try to create, or force, the triangle to a quad of the SS. In order to facilitate a replacement with a predefined texture, it works better. And avoid the overdraw of using forced triangles in SS.

2) Search that the geometry designs are designed to create more square divisions. For example, the plant in X, which is 45ยบ above the quad of the ground, are divisions that seek to follow this angle. If this plant were at 90 degrees, the divisions would be more square.

3) For the theme of textures that look bad. I see complicated that you can automate this. That is, automatically cut the textures, so that new textures are created small, more adjusted to the division. Of course all this results in using more space of VDP1 VRAM.

4) I do not know if it would be possible to use RockinB's UV flat mapping code, which I found from my tests quite quickly. On these triangular primitives, to avoid generating new textures, although you will still have the problem of redrawing by deformation.

5) Use the triangle with a mask as an alternative to forcing triangles. But I do not know how you can translate the coordinates of the vertices to this "triangle", so as not to load the transformations engine or the BSP motor itself.

6) Finally, I do not know if you would use the LOD by distance. Perhaps these zones divided into more "ugly" triangles are not seen with the closest LOD.

Great work and encourage!

I continue with my research and analysis work for my entries. On the other hand I hope to finish my 3D engine proposal soon and share it with everyone. :)

Regards,
10
Project announcement / Re: Sonic Z-Treme
« Last post by XL2 on September 28, 2018, 03:42:17 pm »
Here is a shot of Jade Gully in OpenGL (PC, for testing) after the BSP subdivision.
I just simulate the Saturn behaviour in OpenGL for faster testing.
I'm using a solid leaf bsp tree from the MrGamemaker famous bsp tutorial.

You can see, just like Saturn Quake and Saturn Duke Nukem 3D, how it creates some issues with textures because of the lack of texture coordinates.
The way around this is to declare some quads as entities instead of parts of the map to avoid diagonal subdivisions.
Some maps just don't work with it, such as Super Mario 64's peach castle.

I still have no portals and pvs, so I don't know if the maps that currently work will still work after, but it should help reducing the overdraw and speed up collision detection a lot, maybe allowing proper collision detection against the map for ennemies too.
Pages: [1] 2 3 ... 10
SMF spam blocked by CleanTalk