Weber's Rants (tutorials)

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Weber's Rants (tutorials)

Post by D3thAdd3r » Tue Dec 27, 2016 7:14 am

Jubatian wrote:(Maybe I will try to get such a Mode 74 variant done, although then possibly the current Mode 74 will see no usage, just being too complex to be easily understandable)
FoaD alone, is arguably a more valid reason for the current Mode 74 to exist, than some other video modes have :) If I ever do a game that does not require > 24 tiles wide, mode 74 would be my first choice honestly.
CunningFellow wrote:I can show how you COULD use it to write but just not expose that part of the API to limit its use to people that care to look/understand.

SimpleSD is the Uzebox equivilent to Int13H - could be very dangerous with write enabled.
Eh, I need this now. Justification if you will: I have started to use simpleSD for high score in Dig Dug and I am rather happy with the low flash and ram costs over PFF. At least for the test purposes so far, it seems to do the job fast and pulls the data I expect;easy to use. I want to reuse the "_HISCORE.DAT" file that Toorum's Quest(and a new EEPROM-less save version of Alter Ego..and every game I do from here out) uses. No resources or fancy graphics requiring a separate file on this one, just the existing shared high score file(that I hope others will adopt as well). Of course I need to write to this file, and only this file, in the single sector reserved for the game.

So the writing on the high level is totally straight forward and should be no issue here. ram_tiles[] can be a buffer to read the existing sector, insert the new data, and write it back. I suppose I should do my own research on the command sequence required to get the card to write, but if it is not too much trouble I'd appreciate your description of the process. I very much trust your knowledge on this subject over my own research I have not even started to stumble forward on.

Edit-I read through sdbase.s and I thought I had an understanding on it. Nope.

I tried different variations of this:

Code: Select all

void SDSetup(){
	ResetSprites();
	sdCardInitNoBuffer();//using CunningFellow's simpleSD!
	uint32_t sectorStart = sdCardFindFileFirstSectorFlash(PSTR("_HISCOREDAT"));
	sdCardCueSectorAddress(sectorStart+0x11);//goto first byte of Dig Dug slot in shared high score file
	for(uint8_t i=0;i<sizeof(sd_format_string);i++){
		if(sdCardGetChar() != pgm_read_byte(&sd_format_string[i])){
			sd_state = 0;
			DDCrash();
			return;
		}
	}

	sdCardStopTransmission();
	for(uint16_t i=0;i<10000;i++)
	sdCardGetByte();//eat a stuff byte?
//	sectorStart >>= 9;
	WaitVsync(1);
	sdCardSendCommand(SD_CMD_WRITE_SINGLE_BLOCK,(sectorStart>>9UL),0);//(sectorStart>>16UL),(sectorStart&0xFFFF));
	for(uint16_t i=0;i<514;i++){
		sdCardSendByte(i);
	}
	sdCardSendCommand(SD_CMD_STOPTRANSMISSION,0,0);
}
Meh, I have no idea what I am doing apparently as I have not gotten a single byte written no matter what I have tried.

User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Weber's Rants (tutorials)

Post by D3thAdd3r » Sun Mar 19, 2017 6:59 am

With Block Boy finished I started looking at some of my incomplete games that I do intend to finish(Lolo, MegaBomber, Dig Dug..some day). I couldn't really get back into them right now, and I mean to do things with the expansion devices. I have done a lot of graphical stuff, and testing(non-programming) to see what can fit within the limits. This one will use SPI ram and a 4bpp tile mode, with a 6x8 tile mode on top. It seems now I have a strong idea of what game I can make, and what the limitations will be. If I can actually get this one off the drawing board I will release a demo. It will use SPI ram for the map and other things, hopefully PCM sound effects, and most of the rom taken up with graphics. The concept is to kill 3 birds with one stone(a very unlikely shot), make the tactics RPG I always wanted to, give the SPI ram some justification, and make the work I have done on ESP8266 emulation actually useful(more on that later).

The novelty if it works out, is that only the bare minimum to move objects around and draw the map will be handled on the Uzebox. Past this, it takes any such local choices and sends them, then it watches network data from the server to bring up dialog boxes, run attacks, get items, etc. There is no possible way the code space would fit for what I plan, which is a fairly long and taboo very dark introspection of philosophical human stuff. It may or may not use SD to store music, but the levels and progress will be stored on the server. This will cause some loading times on the order of < 10 seconds for a map change; sucks. What it also does is allow me to release a rom, and update the content on the server as the game is developed. Even if I get it to that point, it would take at least months to get the story and scenarios created. It also allows internet multiplayer without changing much, which is something I am trying to shift all focus to.

All I have is a concept shot, but I have a good amount of art resources to get started and should be able to make anything I need. This obeys the 4bpp, Uzebox palette, and the number of unique tiles is very low to allow night and weather effects:
tactics4.png
tactics4.png (9.29 KiB) Viewed 4443 times
That's all for now, I am not going to explain the mechanics or story but I have spent a good deal of time thinking this through(instead of programming) lately. More will be revealed as it comes to be, or it will never be mentioned again because it turned out too big for me to take on.

Edit- sneak peek at a game that is a little closer to done:
ZMGSCTRY.png
ZMGSCTRY.png (17.7 KiB) Viewed 3932 times

User avatar
Artcfox
Posts: 947
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Weber's Rants (tutorials)

Post by Artcfox » Mon Mar 20, 2017 1:02 pm

Wow! Looks (and sounds) like it will be great!

User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Weber's Rants (tutorials)

Post by D3thAdd3r » Wed Mar 22, 2017 7:25 am

Thanks! This is basically the art style that can be expected through out. I will say, that working with a limited 16 color palette is a new and additional challenge I am not used to yet. It causes a certain look to happen, not sure how to describe it but "washed out" a bit for the color compromises, but passable in any case. I still didn't decide but had just assumed it was going to be mode 74 or mode 13...now I am less sure about that.

Kicking it around more I have come up with more refined ideas. Leaning mode 74 so still making all the graphics in 16 color for now. Now I think with a couple things I hope to do, a custom video mode is in order. I believe I can do a mode 3-like, which uses none of the '644s ram for vram and allows for massive scrolling levels around 256x256 tiles(uses 1/2 of SPI ram). The ~800 bytes normally used for vram is simply sourced from SPI ram instead. Scrolling would cost nearly 0 user cycles. Changing vram becomes more expensive, but this game will rarely change vram after the initial load. Then I can get full color range(still no greyscale on Uzebox but oh well ;) ) and the ram savings allows for > 10 extra ram tiles. Most ram tiles in this game will be User Ram Tiles, with only 1 or 2 active objects being sprite based so 8 sprites max. This is way faster to copy aligned pixels instead of blit, so I believe I could actually fill 50 per frame(or only update ones that changed). With some other tricks like reusing ram tiles of the same soldier type/color on the same flat colored ground where possible, it seems reasonable to expect that 18 characters in a battle could work.

I thought out a split scanline approach to make a more attractive window up top. The one shown was assuming a mode 1-like, but instead it will just be a SPI ram bitmap. The left portrait section of the line will be 4bpp @ 9 cycles, followed by 2bpp for the text portions @ 5? cycles. This way I can have higher resolution text laid over a more ornate background instead of having all text with 1 color backgrounds. This is more similar to the text windows seen in SNES style RPGs. This approach seems relatively easy to implement as a bonus as well as putting yet more out of flash and into SD.

User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Weber's Rants (tutorials)

Post by D3thAdd3r » Mon Apr 03, 2017 2:11 am

A new video is up for an old game, Columns. I have some bigger plans for Columns, it is a game where the development went very badly as work at the time left me no time to continue; never really got it to the point I wanted and I always regretted it. Anyway it basically showcases some gameplay against the CPU player, which is probably the most stand out feature of the game as it sits currently. Check out my other videos if you like, they are all Uzebox and I mean to do some more of the classic Uzebox games. More retro computer stuff might be in the line up eventually, perhaps some Uzebox 128 stuff who knows.

User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Weber's Rants (tutorials)

Post by D3thAdd3r » Mon Apr 03, 2017 4:35 am

Did a few more tonight for fun.



I guess it is so easy to just play a game for a bit and record it(no editing or voice overs make production simple!) that I will try to do every title in the library. I am so rusty at a few so I will have to practice first so the videos can be of decent gameplay quality. More to come, might as well get some more media out there for people to see. Can probably do it in a week or two if I stick to it.

User avatar
Jubatian
Posts: 1368
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Weber's Rants (tutorials)

Post by Jubatian » Mon Apr 03, 2017 3:56 pm

Nice stuff! The AI in Columns has monster difficulty (although I think I mentioned that before). What are you using for recording by the way? (Frogger is definitely a nice example of good Mode 2 usage with parallax scrolling)

User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Weber's Rants (tutorials)

Post by D3thAdd3r » Tue Apr 04, 2017 1:43 am

Frogger is well designed indeed, Paul put a real style at all those classics. One of the few games that really used screen sections to the max(I can't think of another off the top of my head actually).

Columns AI is my best yet, though I always do the same weights/accumulators method. It's basically all about making the evaluation function fast and good, a few smart hard generalizations, and the "neurons" take care of the rest. Probably some assembly should be done as all the cycles go there(30hz based around the AI, it was no competition for a human at 60hz).

Recording for those was Uzem 2.0 using "-r" dumping to ffmpeg.

User avatar
Artcfox
Posts: 947
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Weber's Rants (tutorials)

Post by Artcfox » Thu Apr 06, 2017 3:09 am

These video playthroughs are great. I did a full playthrough of Bugz a long while back, complete with all the mistakes I made along the way. It was 26 minutes long IIRC.

User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Weber's Rants (tutorials)

Post by D3thAdd3r » Sun Apr 09, 2017 6:50 pm

I don't recall seeing a long version, but I saw your short version. By the looks of your playing, you have the game absolutely mastered...I suppose that makes sense though ;) I will have to brush up my skills on it and make a video on Bugz also.

It is basically random so far how I am choosing which video to make next, and I have come up with these ones. Luckily I don't feel bad to put huge amounts of random post to this particular thread, so for convenience and the hopes someone will watch them, here are the new videos:







The Whack A Mole one I was having problems with my mouse so easily leaving the window, and the in game sensitivity is much less than my real mouse. So I actually purposely put a load on my (slow) laptop so I would have time to flick it back into the window and continue play without weird glitches and pauses in movement being noticeable as I moved back into the window. I think I over did it, because you will notice it *looks* like super human speed whacking those moles. I might end up redoing that one to be a bit more realistic but I think there are some unresolved issues with the way Uzem handles the mouse. Leaving it for now.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests