I have moved …   Leave a comment

… to Desura http://www.desura.com/members/grigoriipechorin/blogs

… then came back again http://peterlavalle.wordpress.com/

Advertisements

Posted February 6, 2011 by grigoriipechorin in Uncategorized

(As good as … maybe better than) KoTOR Steam Cloud   Leave a comment

I bought KoTOR on Steam. I like KoTOR and didn’t want to deal with the CDs any more – the price tag was worth it for me. I also thought that the Steam Cloud feature was available for all game – I swear their marketing material said something like that somewhere.

Anyway … this can be done with DropBox (or whatever) to store your KoTOR saves. It should work with KoTOR2 and might work with Dragon Age, Jade Dynasty, and Mass Effect 1/2 – if I had those games I would check. You have to change the config file’s path to save so that it points to the DropBox folder

  1. Setup a DropBox folder for the saves
  2. [Optional] Copy “Steamsteamappscommonswkotorsaves” to backup your saves into it
  3. edit “Steamsteamappscommonswkotorswkotor.ini” and change “SAVES” to point to the saves folder you just copied / created
  4. profit

It’s not that big a deal unless you’re like me and like the idea that your saves aren’t going away when your hard drive dies

Posted December 9, 2010 by grigoriipechorin in Uncategorized

Servelet, JSP, and JDBC Database in < 5mb (excluding the JDK)   Leave a comment

I think that I’ve gotten everything for 90% of what people mean when they say “Web Development” as 5mb of files when it’s installed. As far as I can tell, it “does” JSP compilation, “should” run servlets, and (uses SQLite  so that it) includes a “full” JDBC accessible SQL database.

(You’ll still need the JDK, which adds another 75mb download plus whatever it takes to install it … if you pre-compiled JSP files you might be able to get away without any JSP stuff)

It’s composed of:

  • winstone-lite servlet container
  • some jasper files from tomcat5.5
  • two jars from ant (these are the biggest things)
  • SQLite jar

My goal here was to make the installed footprint smaller than the latest Windows PHP Installer, with bonus points if it’s < 20% of the JDK size – a play on the http://en.wikipedia.org/wiki/Pareto_principle

Posted November 9, 2010 by grigoriipechorin in weaving, web, winstone

My CV   Leave a comment

EntryGameDev

Posted October 26, 2010 by grigoriipechorin in Uncategorized

How not to build a computer game   Leave a comment

I want to build a computer game. I tried programming components – but that didn’t work because there was no way to direct what to do other than building a feature list that goes on forever.

The other week I started trying to write a design document. I realized the game it would make really sucks. It’s a cute story, but I can’t imagine it being fun to play.

So I’m starting over. I’m trying to keep my mind on the game play, and build the world to suit that, rather than the other way around (whoops) Hopefully it’ll work this time …

Posted October 15, 2010 by grigoriipechorin in weaving

“EasyMock” style continuations in Java …   Leave a comment

Wouldn’t it be great if you could do this:
useResultFor(bar.foo(), new Continuation());

… when “bar” was a proxy object that wouldn’t return any-time soon?

Actually … it’s  possible, as long as you don’t mind doing it in a purely OO approach.
(Sorry about the lack of indentation … I can’t seem to get around it)


import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.LinkedList;

/**
* I called the class "French" because I was thinking of EasyMock (which I think
* is French)
*
* @author Peter LaValle
*/
public class French {

/**
* A {@link Boo} interface just has a {@link Boo.foo} method.
*
* @author Peter LaValle
*
*/
public static interface Boo {
Integer foo();
}

/**
* A {@link Continuation} will be run with some value
*
* @author Peter LaValle
*
* @param
*/
public static interface Continuation {
public void run(T value);
}

/**
* This would be {@link ThreadLocal} in real life ...
*/
public static final LinkedList CALLED_METHODS = new LinkedList();

/**
* While we don't *need* all of these in this demo, they would be required
* in a real implementation.
*/
public static final Class[] PRIMITIVE_BOXES = new Class[] {
Byte.class, Character.class, Short.class, Integer.class,
Long.class, Float.class, Boolean.class, Double.class };

/**
* Let's go ...
*
* @param args
*/
public static void main(String[] args) {

// First we're going to implement the class {@link Boo} as a proxy that
// just catches invocations.
// This is being done as a proxy because ... well ... that's how I
// wanted to use this technique in my project.
final Boo bar = (Boo) Proxy.newProxyInstance(
French.class.getClassLoader(), new Class[] { Boo.class },
new InvocationHandler() {

@Override
public Object invoke(Object proxy, Method method,
Object[] args) throws Throwable {

// we check that CALLED_METHODS is empty ..
assert CALLED_METHODS.isEmpty();

CALLED_METHODS.add(method);

return null;
}
});

// Now that we have this neat little proxy object, we use the {@link }
// to call our dynamic continuation.
useResultFor(bar.foo(), new Continuation() {

@Override
public void run(Integer value) {
System.out.println("Integer = " + value);
}
});

// just for fun ...
useResultFor(bar.toString(), new Continuation() {

@Override
public void run(String value) {
System.out.println("String = " + value);
}
});
}

public static void useResultFor(T willBeNull, Continuation logic) {

assert null == willBeNull;

final Method method = CALLED_METHODS.removeLast();

// in real life, we'd run our remote query to get the result of this
// value before passing it to logic below
if (method.getName().equals("foo")) {
logic.run((T) new Integer(7));
} else {
logic.run((T) method.getReturnType().cast("Squirell!"));
}
}
}


So the proxy is just putting the method (or whatever) onto a ThreadLocal stack for later use, and the “useResultFor” method picks it up and knows what to do with it.

Posted October 2, 2010 by grigoriipechorin in weaving

It must be …   Leave a comment

A film should work through … visual imagery. Dialogue can carry it, but you’re better off conveying the story with cinematic elements. Radio plays can be all about dialogue

A book should be about the wording.

A game should convey it’s meaning in game play. The other stuff should help spell out what that point is, but not try to deliver the point on their own

Posted October 1, 2010 by grigoriipechorin in Uncategorized