CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 139 users online: 7 members, 105 guests and 27 bots.
Members: HOMER-16, Tari.
Bots: Spinn3r (1), Magpie Crawler (2), VoilaBot (6), Googlebot (16), MSN/Bing (1), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
    » Goto page 1, 2, 3, 4  Next
» View previous topic :: View next topic  
Author Message
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 08 Oct 2011 07:07:21 pm    Post subject: Trio and Niko

After a long hiatus and many changes, Trio and Niko is being worked on again! This, my OCD project that's been going on for heaven knows how long, finally has progress. Lately I've been working with building my foundations with C, and decided to learn SDL. So, after having been reading SDL tutorials/writing actual code for the past few days, here is what I have to share:


Link


Windows Binary (I suggest you try it -- the recording above is low-quality, and makes my shooting star look ugly :< )
http://www.mediafire.com/?32k2w2ll8ansfhz

I was trying to finish the star-sparkling effect and the option selection thing before I posted this, but I was too eager; the only star animations I *did* get done was the shooting star Razz
_________________
-Ashbad


Last edited by Ashbad on 30 Jan 2012 09:18:21 am; edited 2 times in total
Back to top
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 16 Oct 2011 08:42:22 am    Post subject:

New update, title screen finished (and a lot more things I can't show yet, such as preliminary load/save screen, simple actual gameplay testing, etc.):


Link


EDIT: the recording is very low quality, I assure you it's very smooth in real life Smile
_________________
-Ashbad
Back to top
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 20 Oct 2011 05:28:19 pm    Post subject:

Well, it's been holding progress for some time, so... what do you think of my ASCII table, holding values from 32 (space) to 128 (DEL) exclusive?


_________________
-Ashbad
Back to top
seana11


Super-Expert


Joined: 23 May 2011
Posts: 833
Location: Well, the sign says "You are here"...

Posted: 20 Oct 2011 07:15:42 pm    Post subject:

Ashbad wrote:
Well, it's been holding progress for some time, so... what do you think of my ASCII table, holding values from 32 (space) to 128 (DEL) exclusive?



I can get this with google faster than I can figure out how you organized this.
_________________

Code:
-----BEGIN GEEK CODE BLOCK-----
GCS d- s+: a---@ C+++ UL++ P L+++ E- W++ N o? K? w--- O? M--
V- PS++(--) PE- Y+ PGP t 5? X(+) R tv-- b++(+++) DI+(++)
D(+) G e-(*)>++@ h! r!>+++ y?
------END GEEK CODE BLOCK------
decoded
Back to top
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 20 Oct 2011 08:33:52 pm    Post subject:

Not quite sure the implication of "get this with google", there Razz

With that being said, it took like 2 minutes to actually code in the text drawing system, and it looks swell IMHO:


_________________
-Ashbad
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55879
Location: Earth, Sol, Milky Way

Posted: 21 Oct 2011 12:19:41 am    Post subject:

Haha, I love the test strings that you used. Very Happy I find that font slightly hard to read though; I might like a few tweaks at some point, if you're open to suggestions. If not, it's also quite good as-is.
_________________


Back to top
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 21 Oct 2011 06:12:01 am    Post subject:

KermMartian wrote:
Haha, I love the test strings that you used. Very Happy I find that font slightly hard to read though; I might like a few tweaks at some point, if you're open to suggestions. If not, it's also quite good as-is.


Indeed, some things I'm thinking of changing is letter space from 6 pixels to 5 pixels (it looks okay, a bit squished, but for the most part a bit more legible), make the lowercase 't' look more like it's lowercase, etc. What ideas do you have?

EDIT: this is what it looks like with text one pixel closer together and the 't' fixed:




EDIT2: this is likely to be the finalization for the character spacing; I changed a few more misc. characters, but nothing really that major. What is good is that spacing is handled differently for each type of character (punctuation marks have less room than lowercase, which have less room than uppercase and a few weird characters I'm unlikely to use much.) Comments and suggestions? If not, I'm moving on into drawing the text into a text box in a sophisticated manner.


_________________
-Ashbad
Back to top
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 21 Oct 2011 10:13:50 pm    Post subject:

Wanna see my prototype load save and placeholder options screen? Smile Well, here ya here ya gogogo:


Link


Now that you can see the text more in action, any more suggestions/comments?

On a side note, I should have some basic options coded into the options screen tomorrow, and probably file save recognition. I'm thinking 3 different files for different slots -- though I'll try out multiple things and see what works (by "file save recognition" done by tomorrow, it would likely just be finding the files and check if they exist, and maybe show a player name stored in the first 16 bytes of the file)
_________________
-Ashbad
Back to top
_player1537


Guru-in-Training


Joined: 25 Nov 2009
Posts: 2958

Posted: 21 Oct 2011 10:29:03 pm    Post subject:

LIES. Scheme is _way_ better.

That said, I still find the font very, very difficult to read. It's not impossible, but it could definitely be better, though if you are going for the pixelated look, then you've definitely hit it Smile
_________________
http://tanner.myserverathome.com
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55879
Location: Earth, Sol, Milky Way

Posted: 21 Oct 2011 11:28:46 pm    Post subject:

It's both pixelated and scripty, two things that don't usually combine to provide great readability. I suspect that if he made it just pixelated or just scripty, though, it wouldn't give the feel that he's trying to go for.
_________________


Back to top
ephan


Super-Expert


Joined: 12 Nov 2010
Posts: 819

Posted: 22 Oct 2011 04:30:32 am    Post subject:

Ashbad, that's looking pretty neat (the game). Regarding the font, you shouldn't really mix handwritten letters and computer letters, it affects readability.

I'm curious about the technologies you're using for this game. Is it SDL with OpenGL? Or is it SDL with the SDL video? What about for drawing text, how are you handling it? Thanks.
Back to top
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 22 Oct 2011 09:02:48 am    Post subject:

KermMartian wrote:
It's both pixelated and scripty, two things that don't usually combine to provide great readability. I suspect that if he made it just pixelated or just scripty, though, it wouldn't give the feel that he's trying to go for.


Indeed, I'm going for pixelated and scripty (if that's the way to describe it). Here's some background: the actual screen buffer size is 768*512 (don't yell at my plz for not making it 640*480 kthx), and the intermediate screen (which I actually draw on) is 192*128. Every time I update the main screen, it basically just scales up the smaller screen by a scale of 4. So, since the true screen size I'm working with is small (I'm really going for a retro gameboy/calculator feel) I have to have a small font size. In reality, the characters are 5*6 pixels large -- not much larger than the small TIOS ones on an 8x calculator, and smaller than the normal characters on the TIOS for an 8x calculator.

It *is* a weird setup, but the only real concern that is valid is that the scaling up is very time intensive, but tests I ran seem to show that my very, very simple method really has little (and in many tests, seemingly no) effect on the overall speed.

ephan wrote:
I'm curious about the technologies you're using for this game. Is it SDL with OpenGL? Or is it SDL with the SDL video? What about for drawing text, how are you handling it? Thanks.


It's just SDL with SDL standard video mode, which is really all I need.

For drawing the text, I'm actually not using a TTF -- it's less useful for my purpose and a lot more work. I simply have a PNG that looks like this (with a few recent changes, I cut the 1 pxl wide buffer between characters and changed a few):




And for the rudimentary drawstring function, I made this:


Code:
// draw a null terminated string in my cool glyphs
void drawstring(char*string, int x, int y) {
    SDL_Surface*glyphs = load_image("resources\\images\\font_table.png");
    int temp_x = x;
    for(int j = 0; j < strlen(string); j++) {
        if(*(string+j)==32) {  x+=5;
        } else if(*(string+j)=='\n') { y+=7;
            x = temp_x; } else {
            drawsprite(x, y, 5, 6, glyphs, (*(string+j))%16*5, ((*(string+j))-32)/16*6);
            x+=(6-(*(string+j)>='a'&&*(string+j)<='z'));
        }
    }
    cleanbuf(glyphs);
}

_________________
-Ashbad
Back to top
ephan


Super-Expert


Joined: 12 Nov 2010
Posts: 819

Posted: 22 Oct 2011 09:10:37 am    Post subject:

I see, I've heard of that technique (having an image with characters and a function) to draw them. Thanks, and good luck with coding!

I usually use TTF, it's cool because I can use pre-existing fonts with .ttf files.
Back to top
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 22 Oct 2011 09:14:13 am    Post subject:

ephan wrote:
I see, I've heard of that technique (having an image with characters and a function) to draw them. Thanks, and good luck with coding!

I usually use TTF, it's cool because I can use pre-existing fonts with .ttf files.


Cheers.

TTFs are good for many purposes indeed, but this is one of the few times it's more of a hassle, so I decided to to make life difficult for me and use them.
_________________
-Ashbad
Back to top
ephan


Super-Expert


Joined: 12 Nov 2010
Posts: 819

Posted: 22 Oct 2011 09:15:01 am    Post subject:

Also, in your code, it seems to create an SDL_Surface... How did you add it to the video surface? Thanks.
Back to top
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 22 Oct 2011 09:20:23 am    Post subject:

ephan wrote:
Also, in your code, it seems to create an SDL_Surface... How did you add it to the video surface? Thanks.


Sounds like someone needs their own "SDL Help" topic Wink I'd prefer not to sidetrack my own game thread too much, but in your own help topic, I'd be glad to lend you a boatload of helpful SDL-wrapping functions I made, and explain how to apply surfaces to the video screen and such.
_________________
-Ashbad


Last edited by Ashbad on 22 Oct 2011 09:22:18 am; edited 1 time in total
Back to top
ephan


Super-Expert


Joined: 12 Nov 2010
Posts: 819

Posted: 22 Oct 2011 09:21:57 am    Post subject:

Ashbad wrote:
ephan wrote:
Also, in your code, it seems to create an SDL_Surface... How did you add it to the video surface? Thanks.


Sounds like someone needs their own "SDL Help" topic Wink I'd prefer not to sidetrack my own game thread too much, but in your own help topic, I'd be glad to lend you a boatload of helpful SDL-wrapping functions I made.


You have your point, I was simply curious of how SDL works. Either way, will this game be cross platform? Or are you using Windows-only libraries?
Back to top
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 22 Oct 2011 09:28:38 am    Post subject:

Well, SDL itself is cross platform, and I'm not using any windows-only libraries (in fact, I'm only using stdlib.h and stdio.h for any non-SDL libraries). It could be ported to other platforms with relative ease, and maybe at some point I'll make a Linux build -- but it's not quite far enough into the development process to even worry about that.

As for what would have to be changed to build a linux binary, the paths would have to be changed from using '\\' to denote path levels to '/', and maybe a few other things here and there, and likely a rebuilt makefile. Not that much work Smile
_________________
-Ashbad
Back to top
ephan


Super-Expert


Joined: 12 Nov 2010
Posts: 819

Posted: 22 Oct 2011 11:02:54 am    Post subject:

Quote:
As for what would have to be changed to build a linux binary, the paths would have to be changed from using '\\' to denote path levels to '/',


Reading that on your code was what first made me think if you were releasing it to Unix systems. Cool, then, since cross-platform is always appreciated.
Back to top
Ashbad


I am governor Jerry Brown


Joined: 01 Dec 2010
Posts: 2423
Location: There lived a certain man in Russia long ago

Posted: 22 Oct 2011 11:35:49 am    Post subject:

Indeed. It'll be easy to make a Linux build, since I run Fedora in VB already, and today I'll be loading it to my D: partition, and likely will migrate my source over there later on.
_________________
-Ashbad
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page 1, 2, 3, 4  Next
» View previous topic :: View next topic  
Page 1 of 4 » All times are GMT - 5 Hours

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.044242 seconds.