Hucast is looking for a coder to build a KOS based Framework

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
HUCAST
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 15
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Mon Feb 09, 2015 9:06 am
Has thanked: 0
Been thanked: 0

Hucast is looking for a coder to build a KOS based Framework

Post by HUCAST »

Hi. I'm the Game Designer of DUX, Redux.

I am now looking for a coder who can code a KOS based Framework for us.
We'll need this Framework to port or game The Ghost Blad from PC to Dreamcast.

We will do the port by ourselve but we need a Coder that has a clou about KOS, and using the GPU to display highres graphics.So we mainly need the Framwork to manage Texture and Sprites for Compression. So it can automaticly do the sprite and Texture managment.
With such a Framework weport the game more easy.

Any more info you need?

I'm also in the dreamcastdev irc if you look for me. You can also reach me trough email: info@hucast.com

Best Regards,
René from HUCAST

Checkout: http://www.tgb.hucast.com
my skyp id: hucast.com

Update:
What we would need is a simple demo program:

With a simple game loop with 1 alpha channel sprite that can be moved with the joypad plus a background.
The sprite/bg needs to be drawn with polygons.
Examples with using alpha blending / normal, texture compression.
Sprite animation via changing the texel values to a list generated by a sprite sheet tool.
Loading and unloading of textures
Memory management

Current KOS version compiled for windows
Texture converter compiled for windows
Last edited by HUCAST on Tue Feb 10, 2015 3:02 pm, edited 1 time in total.
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by bogglez »

How are you rendering your sprites on the PC?
The OpenGL library by Ph3nom has made huge improvements and is now very efficient. If you used OpenGL on the PC things should Pretty Much Just Work (TM).
viewtopic.php?f=29&t=103377&p=1046524#p1046465

I also experimented with texture formats and compression using Tvspelsfreak's conversion tool (or the one provided by KOS). Tvspelsfreak's tool also lets you check the quality of the conversion easily (by exporting back to PNG from the converted VQ format).
I suggest you convert your textures using one of those two tools at build time and load the converted versions at runtime. You also get bilinear filtering for free if you twiddle the textures.
You can check out this thread: viewtopic.php?f=29&t=103369

If you decide to use those tools I think you can get some support from the community here and there. Your use case should be interesting :)
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
HUCAST
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 15
Joined: Mon Feb 09, 2015 9:06 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by HUCAST »

I'm currently have all sprites in 32bit TGA but I can convert them easily tp PNG. The other thing is that I need to place the sprite frames on a standard size Texture, I dunno how to call this but you can check here is an example: https://dl.dropboxusercontent.com/u/188 ... lo_mid.png

Maybe there's a tool that can do that automatically?

The other problem is that its all for Linux. I'm actually look for someone who can develop a Framework for us for Windows, so we don't need to build a tool chain in Linux which we cant use anyway. It won't be a problem if the coder takes open source tools from Linus and converts them to windows though.
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by bogglez »

HUCAST wrote:I'm currently have all sprites in 32bit TGA but I can convert them easily tp PNG.
You don't need to do that. But you should convert them to the custom texture format of the Dreamcast graphics card. Just run the conversion tool on your PNG/TGA/whatever and you will get a Dreamcast texture that the graphics card can use very efficiently.
"VQ compressed textures" are a special texture format that the graphics card can read and will allow you to have much more textures loaded at the same time.
Twiddling just changes the order of the pixels in the texture so that neighbor pixels will be next to each other, this makes bilinear filtering free. Paletted textures might also be interesting.
The conversion tools work on Windows too.
HUCAST wrote:The other thing is that I need to place the sprite frames on a standard size Texture, I dunno how to call this but you can check here is an example: https://dl.dropboxusercontent.com/u/188 ... lo_mid.png

Maybe there's a tool that can do that automatically?
You mean "sprite sheets". There are many tools available that work on Windows/Linux/etc., for example https://www.codeandweb.com/sprite-sheet-maker
Those tools can put your images on a grid or alternatively pack them together to minimize unused space (then they will generate a text file that tells you at what positions the pictures are in the sprite sheet).
They also have command line interfaces, so you can build your game and automatically regenerate the sprite sheet, then automatically convert the sprite sheet image to a Dreamcast image.

Hope that helps.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: Hucast is looking for a coder to build a KOS based Frame

Post by PH3NOM »

HUCAST wrote:Hi. I'm the Game Designer of DUX, Redux.

I am now looking for a coder who can code a KOS based Framework for us.
We'll need this Framework to port or game The Ghost Blad from PC to Dreamcast.

We will do the port by ourselve but we need a Coder that has a clou about KOS, and using the GPU to display highres graphics.So we mainly need the Framwork to manage Texture and Sprites for Compression. So it can automaticly do the sprite and Texture managment.
With such a Framework weport the game more easy.
Hey there man thanks for helping keep the DC alive!

Previously I have written a Stream Buffer solution for streaming video frames to the PVR.
That was used for a video player I was working on, you can look at that source here:
viewtopic.php?f=36&t=103406&p=1045796&h ... r#p1045796

After reading up on PRT(Partially Resident Textures), I think I have some ideas.http://www.anandtech.com/show/5261/amd- ... 0-review/6

My basic idea is to create a Texture Stream Buffer(TSB) of the maximum size in main RAM as well as VRAM, and handle all texture memory management(TMMU). In this model, there will only be one call to pvr_mem_malloc(pvr_mem_available()), done on initialization of the TSB. Generally, we have about 4mb of teture memory on the PVR when things are all said and done.

Basically, your only job would be to bind your sprites to the TSB. The textures should be mip-mapped for optimal performance, otherwise the TSB will have to mip-map the textures for you. This can be done easily by setting the mip-map option when generating the VQ texture on PC.
The amount of sprites bound would not be limited by VRAM, rather main RAM. The SH4 has 16mb main ram, so maybe 8mb could be reserved for the TSB.

The Sprites would be bound as a pointer to the TSB, so each time the Sprite is updated outside of the TSB, its coordinates will autonomously be updated in the TSB.
Each frame, the TSB will first check if the Sprite is On-Screen. Assuming your vertices are 2D coordinates in screen-space ( needing no transformation ), this will be a very simple check.
If the sprite is not on-screen, its texture will not be marked to be loaded into vram.
If the texture is on-screen, the TSB can use software mip-map detection by comparing the area of the texture
against the area of the sprite, and find the mip-map level of the texture that best fits the sprite.
For example, when mapping a 512x512 pixel texture onto a 128x128 pixel sprite on-screen, the TSB would only load the 128x128 level of the mip-map into VRAM, instead of loading the entire 512x512 pixel texture.

After all sprites are checked for needing to be loaded into VRAM, the TSB will go through the VRAM texture list and remove any textures that do not need to be loaded for that frame. Next, the TSB will check available texture memory, and possibly reduce mip-map levels if the textures needing to be loaded will not fit in VRAM, before actually transferring the needed texture data to from RAM into VRAM.

An example of my solution is say you have a player sprite, and a high-res scrolling background sprite.
As the player sprite will likely always stay on-screen, the player sprite will remain resident in VRAM, meaning the TSB will only need to copy the texture from RAM into VRAM one time.
The scrolling background sprite will stay on screen until it eventually scrolls off-screen. This means the TSB will load the texture into VRAM once, and the texture will stay resident until the sprite has scrolled off-screen, at which point the texture will be removed from VRAM by the TSB.

I could go into more detail, but I should probably stop there for now :oops:

Let me know if that makes any sense :o
HUCAST
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 15
Joined: Mon Feb 09, 2015 9:06 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by HUCAST »

Sounds awesome!

I'll check if it will help us. :)

Now I'm dreaming of a new KOS based Software Devkit (SDK)., open source, for everyone :o
HUCAST
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 15
Joined: Mon Feb 09, 2015 9:06 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by HUCAST »

What we would need is a simple demo program:

With a simple game loop with 1 alpha channel sprite that can be moved with the joypad plus a background.
The sprite/bg needs to be drawn with polygons.
Examples with using alpha blending / normal, texture compression.
Sprite animation via changing the texel values to a list generated by a sprite sheet tool.
Loading and unloading of textures
Memory management

Current KOS version compiled for windows
Texture converter compiled for windows
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by bogglez »

All of that seems pretty easy, just these 2:
Sprite animation via changing the texel values to a list generated by a sprite sheet tool.
Do you mean changing the image of a sprite from one image in the spritesheet to another? It sounds like you want to actually change the pixel values (need write access to the textures), or do I misunderstand?
Memory management
It seems like you load the level in stages. Also, you know when enemies will enter the screen (after half of the level etc).
Try the following for level 1: put all the sprites you need into sprite sheets and compress them for the Dreamcast. Then check out how large all those textures are together. If you're below about 4MB you won't even need to stream textures.
If you're significantly above that budget, maybe you can split your sprites up into "first half of level 1" and "second half of level 1", then unload the first half as you enter the second half. No need for a complicated streaming system then.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
HUCAST
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 15
Joined: Mon Feb 09, 2015 9:06 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by HUCAST »

yes texel coordinates

>Do you mean changing the image of a sprite from one image in the spritesheet to another?
Yes
HUCAST
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 15
Joined: Mon Feb 09, 2015 9:06 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by HUCAST »

Well. Maybe Framework was a bit misleading. At least we need the whole Toolchain compiled for windows to port the game. A Framework with sample demo would be more helpfully though.
User avatar
PH3NOM
DC Developer
DC Developer
Posts: 576
Joined: Fri Jun 18, 2010 9:29 pm
Has thanked: 0
Been thanked: 5 times

Re: Hucast is looking for a coder to build a KOS based Frame

Post by PH3NOM »

It sounds like you are asking how to get KOS set up on Windows?

At one point I was having issues getting things set up, so I created a thread here on the subject.
I eventually got things working, and posted a how-to so others could see the step-by-step process at installing a KOS toolchain on Windows:
viewtopic.php?f=29&t=102800&p=1041489&h ... n#p1041492

Once you get the KOS tool chain set up, there are plenty examples included, in the directory kos/examples/dreamcast.

If you use OpenGL, you wont have to worry about the specific details of interacting with the PVR; kos/examples/dreamcast/kgl

Using OpenGL, you specify texture coordinates per-vertex, so changing the frame on a Sprite Sheet would simply imply changing the u/v coordinates per-vertex.
b0b
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 20
Joined: Thu Mar 15, 2007 12:04 pm
Has thanked: 0
Been thanked: 1 time

Re: Hucast is looking for a coder to build a KOS based Frame

Post by b0b »

I don't know what you mean by "framework", but...


I haven't tried setting up the toolchain for windows as i use linux and osx most of the time.

I think you should explain a little how your PC version is made so far. What libraries you use (opengl, openal, sdl etc), is it in c or c++ and so on.

I haven't released anything on the dreamcast (yet), but I tried to port an open-source 3d-shmup-engine. The pc version was using opengl, openal and sdl (context, image loading and input). I managed to get it running on the dreamcast technically, but the project is on-hold currently. the original engine was written with a fixed time-frame in mind. the enemy-encounter is all time-based. like for every level there are given times at that enemies spawns and events occurs... not a good way to design a shmup ;P
i couldn't get the dreamcast version to the same time-step as on the pc and it screws everything up. I've tried to the rewrite the whole thing to be more flexible, but I'm struggling with the the overall design. I honestly don't know how to design a shmup, so I'm stuck on some design-related problems. My main goal was to make it some kind of "shmup-game-maker" :D

the pc-opengl renderer was replaced by KOS-pvr-api, sound and input are direct KOS without SDL. All the png-textures can be used as they are or converted to the native pvr-format. I didn't use the new OpenGL-api for dc, because it wasn't released at the time. And I wanted to try native PVR. Looking back - even if you don't like OpenGL, consider it for DC, as you would have to write all clipping code and all that vertex-array-stuff for fast vertex-transforming anyway...
It works but the enemy-movement is all over the place, timing is completely wrong, but it's not really dreamcasts fault...



@ HUCAST

wasn't DUX using KOS?

If you manage to build the toolchain and KOS for windows - it comes with all examples and tools you asked for.

how is your memory management in the pc version?

I speak german, so feel free to ask
HUCAST
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 15
Joined: Mon Feb 09, 2015 9:06 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by HUCAST »

Yes DUX was made by using KOS but it was made by KTX Software and they won't do the Ghost Blade Port. Also DUX was made in 2008, some of the tools in the chain probably wont exist anymore or will be dated.

I'm in touch with some DC coders now and they all say an port to DC will be easy if they have the Open GL based PC version of the game, so this it what we will now work on.
HUCAST
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 15
Joined: Mon Feb 09, 2015 9:06 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by HUCAST »

b0b wrote:the pc-opengl renderer was replaced by KOS-pvr-api, sound and input are direct KOS without SDL. All the png-textures can be used as they are or converted to the native pvr-format. I didn't use the new OpenGL-api for dc, because it wasn't released at the time. And I wanted to try native PVR. Looking back - even if you don't like OpenGL, consider it for DC, as you would have to write all clipping code and all that vertex-array-stuff for fast vertex-transforming anyway...
So you wont need SDL libs anymore with the latest KOS?
b0b
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 20
Joined: Thu Mar 15, 2007 12:04 pm
Has thanked: 0
Been thanked: 1 time

Re: Hucast is looking for a coder to build a KOS based Frame

Post by b0b »

HUCAST wrote: I'm in touch with some DC coders now and they all say an port to DC will be easy if they have the Open GL based PC version of the game, so this it what we will now work on.

thats that I somehow tried to say. OpenGL-based PC version alone doesn't guarantee an easy Dreamcast port.
For example I would also avoid using XML-files. Parsing them is hard enough. Use the native pvr format for textures. Avoid using new/malloc and delete/free operations as good as possible, I mean constantly allocating and freeing memory in the game loop itself is just a bad idea.

etc. etc.

I see on your screenshots many projectiles - how are they spawned? How are you spawning enemies?

all that stuff you wouldn't notice on a pc, but you would on an old and slow machine like the DC.
So you wont need SDL libs anymore with the latest KOS?
you never really *needed* it in the first place. It just made it easier to port programs to DC without changing too much of the original code. The available SDL-port for DC is quite outdated and wasn't that good either. It's really just a wrapper for the internal KOS-functions. And you can figure out how to do all that in KOS directly. Input is simple enough and you can understand quite easy how the SDL_mixer functions really work by looking at the relevant code sections of the SDL-port.
the new dreamcast OpenGL-api <-> native PVR is a different story through. In it's nature it also "just" a wrapper to the PVR-functions, but there is so much more stuff added to it... which one might implement themself anyway if going native PVR. all that clipping and transformation stuff is really important.
HUCAST
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 15
Joined: Mon Feb 09, 2015 9:06 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by HUCAST »

Thanks for the help guys. I finally have found a coder.
tonma
DCEmu Freak
DCEmu Freak
Posts: 82
Joined: Thu Mar 10, 2016 7:14 am
Has thanked: 0
Been thanked: 1 time

Re: Hucast is looking for a coder to build a KOS based Frame

Post by tonma »

Hi, I have question about the video ram because I wish to make a 2d game with lot of sprites.
I know the video ram is limited to 4Mo.

Can I load data from CD to vram while the game is running whitout freeze ? Like Change the sprite image in different part of the same level.
May I compress the pictures sprites in vram to use less memory size ?

Thanks.
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: Hucast is looking for a coder to build a KOS based Frame

Post by bogglez »

tonma wrote:Hi, I have question about the video ram because I wish to make a 2d game with lot of sprites.
I know the video ram is limited to 4Mo.

Can I load data from CD to vram while the game is running whitout freeze ? Like Change the sprite image in different part of the same level.
May I compress the pictures sprites in vram to use less memory size ?

Thanks.
Yes, you can load data from CD without freezing the game.

Regarding compression, these forum post of mine should be of help to you:
viewtopic.php?f=29&t=103833&hilit=vq+te ... e#p1049094
viewtopic.php?f=29&t=103369&hilit=vq+texture#p1045482
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
tonma
DCEmu Freak
DCEmu Freak
Posts: 82
Joined: Thu Mar 10, 2016 7:14 am
Has thanked: 0
Been thanked: 1 time

Re: Hucast is looking for a coder to build a KOS based Frame

Post by tonma »

bogglez wrote: Yes, you can load data from CD without freezing the game.

Regarding compression, these forum post of mine should be of help to you:
viewtopic.php?f=29&t=103833&hilit=vq+te ... e#p1049094
viewtopic.php?f=29&t=103369&hilit=vq+texture#p1045482
Thanks for fast answer. :wink: That's great for loading data.

I'll read the 2 posts to understand well the compression.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Hucast is looking for a coder to build a KOS based Frame

Post by BlueCrab »

To truly load without freezing things up, you'll need to use threads, since all filesystem stuff is blocking and all.
Post Reply