Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Another (sourceless) Tetris release.

Reply to topic
Author Message
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Another (sourceless) Tetris release.
Post Posted: Tue Apr 11, 2000 8:28 am
Just for the hell of it, I've uploaded the latest version so you can see where it's at.
No source yet, nor a real log of changes. Everything is in flux right now.
Besides, how many of you have read the source, anyway?

One bug:Occasionally, in fact very rarely, when a long-bar shape is dropped inplace when standing on it's end, the screen will not redraw the shape to reflect that it moved down to its final destiation, instead showing it one unit above where it landed. However, the shape will have been marked into place on the (internal) puzzle array, that is, if you drop a shape on top of the long bar that didn't drop correctly, you'll actually be able to move through the ghost square and settle on where the shape really is.
This might be hard to understand from my explaination, but you'll see what I meant after you play for a while. Let me know if you see any sort of stimilus that causes the bug to happen. It's so erratic and evasive that I can't begin to track it down with the debugger.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Re: Another (sourceless) Tetris release. (can't use the link without a title, I guess?)
Post Posted: Tue Apr 11, 2000 8:30 am
I dunno.

  View user's profile Send private message Visit poster's website
Consolemu
  • Guest
Reply with quote
Damn! Good Work!
Post Posted: Tue Apr 11, 2000 10:24 pm
Shoot, that tetris that you have right there is even better than the damn arcade version. I really like that little flare animation that shows when you complete the lines. Did you really do all of this in pure Assembly? If you did, you've got mad patience. I read your post that was a reply to my post, the part about using Allegro to concentrate on making better games...Trust me, that's all I want to do. Write better games. But at the same time, I want to have my own development library that I can call my own. Again, I don't want to have to feel like I need to depend on other people's works to write programs. The knowledge I gain now will probably last me into the future. My mouse routines are actually interpreted by myself, not by the BIOS. Well, I have to versions: one that uses the BIOS and one that I did. Mine's not perfect, but at least I understand the concept. BIOS, you don't learn anything from that. You just call 2 or 3 DOS interrupts to get things rolling. Oh shit, I think I'm blabbering too much. I gotta stop doing that. But anyway, very nice Tetris! You're almost making me want to drop my version and say screw it. I'm not going to give up hope. I gotta learn this stuff, it's beneficial. Ok, I'm shutting up now...

Chris :o)
 
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Re: Damn! Good Work!
Post Posted: Wed Apr 12, 2000 7:23 pm
Quote
> Shoot, that tetris that you have right there is even better than the damn arcade version.

Well, I wouldn't go that far. I still have alot to add in the departments of flair, sound, game variety.... but it's coming along nicely

Quote
> I really like that little flare animation that shows when you complete the lines.

THANK YOU THANK YOU THANK YOU for liking that.
When I first started to add that, it lead me down a path of bugtracking and overhauling that took me a week to get the game working again (the flare effect wasn't enough, it was important that it burn away one line at a time, and drop the remaining pieces down before burning away the next row. that was how it was in my mind, and that was how it had to be.) It was for the best, my row scanner/compresser routine which I thought was 'clever' was really bloated and downright akward, so I ended up implementing a much simpler, cleaner system.

Most of my troubles, however, had to do with tracking down bugs that were introduced when I tried to add the flare effect in 20 minutes at lunch time, and did a piss-poor job of it.

Quote
> Did you really do all of this in pure Assembly? If you did, you've got mad patience.

All assembly (the only real option right now, which is my preference for these things anyway). Sometimes I prototype a more complicated routine in mock-C and trace over it in my mind before I set to work, though.



Quote
> I read your post that was a reply to my post, the part about using Allegro to concentrate on making better games...Trust me, that's all I want to do. Write better games. But at the same time, I want to have my own development library that I can call my own. Again, I don't want to have to feel like I need to depend on other people's works to write programs.

Okay, I hound you on this matter because I've felt the same way in the past, and speaking from experience (and the experience of others who've come to the same conclusions) I'd still have to say you're travelling down the wrong road.
The fact of the matter is, you will always be dependant on the work of others when you program. Even if you shun BIOS routine (how are you reading the mouse input, anyway? tell me you're not reading it from ports, pleeeease), you're dependant on the people who wrote your compiler, your assembler, your libc if you use C. And deeper than that, you're depending on the documentation that people have put together for interacting with hardware. You're depending on the source code you read, the books you buy, the people you ask.
And you will have to code to standards, use libraries, API's, etc., if you want to do this for a living someday. If you want to write PC games, you're almost certianly going to have to depend on directx, the win32api, probably opengl. And you're going to have to write source that runs on unknown hardware. That's the other reason it's good to depend on the 'work' of others... their libraries are in charge of supporting many more configurations than you could every hope to round up and test on.
You are not an Island.
But you do have the right idea, that you shouldn't blindly use other people's code with examining what's it is.
So what it comes down to is this:

Know your tools.
Meditate on that.

It's not necessary to build your own tools, but you should strive for a deeper understanding of what it is you do use (be it the win32 api, or allegro, or the c language itself, or assembly language (which, as I said, is not faster than C if you don't understand all the intricacies involved, and on a modern machine, there are MANY).

You don't have to build them from scratch, so long as you're sure of what your tools are doing.



Quote
> BIOS, you don't learn anything from that. You just call 2 or 3 DOS interrupts to get things rolling.

And that's good, it gets you moving so you can focus on the things that matter.
What is the value of learning how to get mouse movement values from the hardware itself? This is an extremely limited application, one that you'll probably never use in a career of software development, and the knowledge doesn't apply very well to other things.
Look, I'm not saying it's bad to fool around with low-level programming. That can come in handy (it made SMS Tetris possible), and I think it's a good thing for a programmer to have some grasp on the nuts and bolts of machines, but don't get carried away with it, and don't let it distract you from practicing game development.

Let me tell you what you should do:
Get DJGPP and Allegro, if you don't have them yet.
Use allegro only for the simplest things: input, setting the graphics modes, and pixel writes and maybe blitting.
Create your tetris in such a manner that all interfacing with the outside world (i.e. graphics, keyboard input, joystick input, timers, whatever) passes through 'wrapper' functions that you write. Your graphic mode enabler calls the allegro graphics handler, your setpixel calls the allegro setpixel, your timers interface with allegro's.. etc.
When you get it fully funtional (all elements of playability in place, maybe before the bells'n'whistles but that's up to you), then replace all the wrapper functions with your own versions, if that's still what you want to do. I suspect that you might not care much about that anymore.

Quote
> But anyway, very nice Tetris! You're almost making me want to drop my version and say screw it.

I certainly don't mean to devalue your own work. Keep at it.

Quote
>I'm not going to give up hope. I gotta learn this stuff, it's beneficial.

Yep.
  View user's profile Send private message Visit poster's website
  • Joined: 24 Jun 1999
  • Posts: 1732
  • Location: Paris, France
Reply with quote
Re: Another (sourceless) Tetris release. (can't use the link without a title, I guess?)
Post Posted: Wed Apr 12, 2000 9:11 pm
Quote
> I dunno.

It is me or I cannot download the file on this computer? it get corrupted
please zip it up next time =)
  View user's profile Send private message Visit poster's website
Consolemu
  • Guest
Reply with quote
Re: Damn! Good Work!
Post Posted: Wed Apr 12, 2000 9:23 pm
Quote
> The fact of the matter is, you will always be dependant on the work of others when you program. Even if you shun BIOS routine (how are you reading the mouse input, anyway? tell me you're not reading it from ports, pleeeease)

I'm sorry, but yes. I'm reading, bit-wising, and checking the mouse purely from ports. It's cool but it doesn't work well. I can't get the ranges set right.

Quote
>, you're dependant on the people who wrote your compiler, your assembler, your libc if you use C. And deeper than that, you're depending on the documentation that people have put together for interacting with hardware. You're depending on the source code you read, the books you buy, the people you ask.

I do understand that. I'm not saying completely drop the idea of using Allegro or DX. All I'm saying is, I want to see what it's like to do the hardware programming first, then enjoy the royalties and the simplicities of using a development library.

Quote
> And you will have to code to standards, use libraries, API's, etc., if you want to do this for a living someday. If you want to write PC games, you're almost certianly going to have to depend on directx, the win32api, probably opengl. And you're going to have to write source that runs on unknown hardware. That's the other reason it's good to depend on the 'work' of others... their libraries are in charge of supporting many more configurations than you could every hope to round up and test on.

Yeah. Even though Microsoft created the craziest mnemonics for codes, they all make sense. like wPointer or Call_Me.

Quote
> You are not an Island.
> But you do have the right idea, that you shouldn't blindly use other people's code with examining what's it is.

That was the only point I was trying to make before. I'm not shunning APIs, I'm tying to understand how they work and how the hardware works. What if my boss, someday, actually tells me, "Hey kid. I'm sorry bout the Hard Disk that had our APIs was erased. You think you could possibly, uh, say continue the development without them?" I can angrily, but in a proud and sarcastic way, say "Yes sir!".

Quote
> So what it comes down to is this:

> Know your tools.
> Meditate on that.

> It's not necessary to build your own tools, but you should strive for a deeper understanding of what it is you do use (be it the win32 api, or allegro, or the c language itself, or assembly language (which, as I said, is not faster than C if you don't understand all the intricacies involved, and on a modern machine, there are MANY).

I'll concentrate on that stuff later. Basically, what you're telling me is (analogy), "Well, even though you can't read Hexadecimal, binary, or have any concept of the numbering systems, it's okay to use Bob's Hex API and write a Hex viewer." Sure, that person, with the help of the API could accomplish his task. But would he understand how it worked? Would he ever be able to develop stuff that's kicks ass and bends the rules of the API (being that he knows Hex and binary)?
Oh, here's a better analogy. "I want you to write an NES emulator, by using Allegro, S.E.A.L., Marat's 6502 Core, Nofrendo's pAPU library, and nesticle's PPU library. Just give it a cool name and create a nice GUI." Well, mabye that analogy was a bit off. I dunno. Nevermind.

Quote
> You don't have to build them from scratch, so long as you're sure of what your tools are doing.

Well, there's a lot of things that API's do that I'm not sure how they do it. I just know what they do. Example, I tell DX to load a pointer and declare a structure. I don't know how the pointer works nor do I know what's in the structure. All I know is that if I declare those two, I can do some neat DX stuff. Not that it's required for me to know...just one of those things I personally would like to know how to do.

Quote
> And that's good, it gets you moving so you can focus on the things that matter.

*snip*

Basically, everything you've been telling me, I understand. But you wouldn't be the kick ass programmer that you are today if you wouldn't have done what I'm trying to do now, am I right? Tetris wouldn't have been possible in Z80 assembly unless you had a clue as to how the hardware worked. Assembly isn't possible unless you've done hardware programming in the past and you understand. Most idiots out there today, get paid 80 or so grand a year, yet they don't know what FF stands for. I don't want to be just another idiot. I want to be flexible. I want to be able to add variety to my programs. And the little things that I'm learning now, like dithering, blitting, masking, bitwise-operators, reading/writing hardware, will pay off. Somehow, I think it will pose useful.
 
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Re: Another (sourceless) Tetris release. (can't use the link without a title, I guess?)
Post Posted: Wed Apr 12, 2000 10:13 pm

Quote
> It is me or I cannot download the file on this computer? it get corrupted

It's you. How are you downloading it that it gets screwed up?


Quote
> please zip it up next time =)

maybe
  View user's profile Send private message Visit poster's website
  • Joined: 18 Sep 1999
  • Posts: 498
  • Location: Portland, Oregon USA
Reply with quote
Re: Another (sourceless) Tetris release. (can't use the link without a title, I guess?)
Post Posted: Thu Apr 13, 2000 12:45 am
Quote
>
> > It is me or I cannot download the file on this computer? it get corrupted

> It's you. How are you downloading it that it gets screwed up?


I had the same problem. When I download it using Netscape (4.7), the file size is too large. I believe the problem relates to the old DOS carriage return/line break problem. Netscape is interpreting certain data bytes as a carriage return and is automatically inserting a line break. The question is why does Netscape interpret the file as an ASCII file (and not a binary file)? Internet Explorer does not have this problem.

Zoop, check if the file you downloaded is greater than 32768 bytes in size. If so, you are probably experiencing the same problem I had. In any case, a zipped version is available in the Source Code section of this site.

Eric Quinn
  View user's profile Send private message Visit poster's website
  • Joined: 24 Jun 1999
  • Posts: 1732
  • Location: Paris, France
Reply with quote
Re: Another (sourceless) Tetris release. (can't use the link without a title, I guess?)
Post Posted: Thu Apr 13, 2000 6:26 am
Quote
> Zoop, check if the file you downloaded is greater than 32768 bytes in size.

Yeah I had that problem, it was 64 bytes too large actually.

Quote
>If so, you are probably experiencing the same problem I had. In any case, a zipped version is available in the Source Code section of this site.

Thanks!
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Re: Another (sourceless) Tetris release. (can't use the link without a title, I guess?)
Post Posted: Thu Apr 13, 2000 4:04 pm

Quote
> I had the same problem. When I download it using Netscape (4.7), the file size is too large. I believe the problem relates to the old DOS carriage return/line break problem. Netscape is interpreting certain data bytes as a carriage return and is automatically inserting a line break. The question is why does Netscape interpret the file as an ASCII file (and not a binary file)? Internet Explorer does not have this problem.

ah, yes, I haven't used Netscape in a while (except when I boot up in linux, which is more or less never)

If I remember correctly, right-click/save-as should save the file without interpretation.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!