Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3D Chess Program in FreeBASIC
#11
Hi:

I have updated FBChess:

http://weekendcode.phatcode.net/


1. It is now possible to move and rotate the board by dragging with Right Mouse button down. The board can be raised/lowered using the mouse wheel.

2. I disabled the blue square for mouse input so that the user will have better feedback when the computer is not smart enough to figure out what he/she wants to do. Now it should be visible only when using the keyboard. I added logic checks to screen out invalid moves. I hope this helps with the problem reported by v3cz0r.

3. I added a pawn promotion dialog. The old keyboard method was unresponsive.

4. Added a warning to the web page to only use the program on a fast computer!

I tried FBChess on a 4 year old PIII running WinMe, and it ran 10 times slower than on my laptop (only 5 frame per second compared with 50). This a much bigger difference than I would have guessed. Perhaps it has to do with the OpenGL support in the hardware.

This is unusable as the user input is captured in the same loop as drawing the 3D models. It keeps skipping user input.

I don’t see how you could improve this without changing the 3D models. Using events for user input would help, but it would still be slow. I will play around with it and see if I come up with anything.

Thanks for the feedback.

Garvan
Reply
#12
Could you release of it amodification with 2D interface -for older computer?

you could make 2 different UI modules -and link wichever user wishies while compiling. I guess underlying system is the same.
url]http://fbide.sourceforge.net/[/url]
Reply
#13
hey, I played i bit around in your code. here's small suggestion:
this code is in: FBChess.bas line 426

[syntax="QBASIC"] IF (MOUSEB AND 2) and (MOUSE_X>-1) and (MOUSE_Y>-1) THEN

IF OLDMOUSE_X > MOUSE_X THEN
u = u - 0.01 * ( OLDMOUSE_X - MOUSE_X )
ELSEIF OLDMOUSE_X < MOUSE_X THEN
u = u + 0.01 * ( MOUSE_X - OLDMOUSE_X )
END IF

IF OLDMOUSE_Y > MOUSE_Y THEN
y = y - 1.0 * ( OLDMOUSE_Y - MOUSE_Y )
ELSEIF OLDMOUSE_Y < MOUSE_Y THEN
y = y + 1.0 * ( MOUSE_Y - OLDMOUSE_Y )
END IF

IF OLDWHEEL > WHEEL THEN
w = w - 0.5*2
ELSEIF OLDWHEEL < WHEEL THEN
w = w + 0.5*2
END IF
END IF[/syntax]

a bit easier mouse rotation handling :wink:
url]http://fbide.sourceforge.net/[/url]
Reply
#14
Quote:hey, I played i bit around in your code. here's small suggestion:
this code is in: FBChess.bas line 426

[syntax="QBASIC"] IF (MOUSEB AND 2) and (MOUSE_X>-1) and (MOUSE_Y>-1) THEN

IF OLDMOUSE_X > MOUSE_X THEN
u = u - 0.01 * ( OLDMOUSE_X - MOUSE_X )
ELSEIF OLDMOUSE_X < MOUSE_X THEN
u = u + 0.01 * ( MOUSE_X - OLDMOUSE_X )
END IF

IF OLDMOUSE_Y > MOUSE_Y THEN
y = y - 1.0 * ( OLDMOUSE_Y - MOUSE_Y )
ELSEIF OLDMOUSE_Y < MOUSE_Y THEN
y = y + 1.0 * ( MOUSE_Y - OLDMOUSE_Y )
END IF

IF OLDWHEEL > WHEEL THEN
w = w - 0.5*2
ELSEIF OLDWHEEL < WHEEL THEN
w = w + 0.5*2
END IF
END IF[/syntax]

a bit easier mouse rotation handling :wink:

This is a nice improvement.

I have a FreeBASIC console version that I built before putting the OpenGL front end on it, so I could put a 2D front end on it for older computers. The biggest hassle is menu’s. I would like try out the other gfx modes but some form of menu is needed for the program.

We will see.

Garvan
Reply
#15
I made a simple gui (it's total crap as it is) but maybe that will help a bit: http://www.hot.ee/fbide/GUI.rar it has buttons, scrollbars and a readonly textarea, but since it is quite object based. adding menus isn't hard. Just follow the way buttons and scrollbars are implemented to the gui. if you like it and wanna use it then contact me if you need help.

Von
url]http://fbide.sourceforge.net/[/url]
Reply
#16
Could someone please host this from QuickHost? I'm at a college campus and it filters the current link.
Reply
#17
Download GUI.rar
Reply
#18
Quote:I made a simple gui (it's total crap as it is) but maybe that will help a bit: http://www.hot.ee/fbide/GUI.rar it has buttons, scrollbars and a readonly textarea, but since it is quite object based. adding menus isn't hard. Just follow the way buttons and scrollbars are implemented to the gui. if you like it and wanna use it then contact me if you need help.

Von

Thanks for this, it was exactly what I was looking for.

I managed to hack in a main menu with a pop-down menu, so now I need to sit back and take a look to see if I can tidy it up a bit.

I did the graphics for 2D chess pieces also, but I will be traveling for the next few days so I will leave it for a while.

Thanks

Garvan
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)